BUG?: af:resource and page fragments

person Bijeshfolder_openADFlocal_offer, , access_time January 27, 2012

I was working on a PoC to integrate Bing and Google maps with webcenter. The idea was to use the javascript apis for this. While doing this, I encountered this strange issue.

I had a taskflow with two page fragments and this was meant to be embedded as a region in another page. The bug is that javascript included using the af:resource doesn’t get loaded in any page fragment other than the default activity. Presumably looks like the af:resource contents are not (re)painted when the region gets repainted. This happens with inline javascripts and also source-linked javascripts. The workaround is to use trh:Script instead of af:resource or (less elegantly) to embed all the required javascript into the default activity page. I chose to go with option 1.

P.S: There are other gotchas with the maps integration. I had to turn off PPR navigation to make the maps work. It looks like neither the Google nor the Bing API is particularly fond of div’s that are dynamically inserted into the HTML DOM. That is what I think happens with PPR navigation i.e. ADF rewrites the DOM (via Javascript?) with the new page elements.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>