Problems converting from AjaxAnywhere to Ajax4Jsf
andrew.rw.robinson Mar 13, 2007 6:51 PMI finally have the time to do a little research of converting our project from AjaxAnywhere to Ajax4Jsf. For the most part, it is working, but there are some issues.
Environment:
Ajax4Jsf 1.1.0
JBoss-Seam 1.1.6
Facelets 1.0.14
MyFaces 1.1.3 (patched)
MyFaces Tomahawk 1.1.3 (patched)
What I did to convert:
Added an a4j:region at the root level of my template (entire page basically)
Changed all <aa:zoneJSF id="..."> to <a4j:outputPanel id="...">
Added global status with JavaScript hooks for the start & stop.
Here is part of the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <t:document xmlns="http://www.w3.org/1999/xhtml" ...> <f:loadBundle basename="jsfmessages" var="msg" /> <body onload="zfpOnLoad();" onresize="zfpOnResize();"> <t:documentBody state="start" /> <a4j:region id="zfpAjaxRegion" selfRendered="false" keepTransient="false"> ... PAGE BODY HERE .... <a4j:status id="ajaxStatus" for="zfpAjaxRegion" onstart="onAjaxRequest();" onstop="onAjaxResponse();" startText="" stopText="" /> </a4j:region> <t:documentBody state="end" /> </body> </t:document>
With this approach, the UILiteralText and UIText of facelets always cause:
16:32:48,870 DEBUG [NavigationHandlerImpl] handleNavigation fromAction=#{contentMgr.load} outcome=loaded no matching navigation-case found, staying on current ViewRoot 16:32:48,929 INFO [[/OSoft]] WARNING: Component _id366 just got an automatic id, because there was no id assigned yet. If this component was created dynamically (i.e. not by a JSP tag) you should assign it an explicit static id or assign it the id you get from the createUniqueId from the current UIViewRoot component right after creation!
Also it seems like that the view may be getting re-created each request (but not sure).
If I change the region to:
<a4j:region id="zfpAjaxRegion" selfRendered="true" keepTransient="true">
Then all my "zones" do not get reloaded, and the area is left blank and there are some errors about not finding images (perhaps a problem with the message bundle loaded with a plain loadBundle?).
I cannot break the regions up at this time as it is too much effort at this time, so the one region for the entire page is unfortunately our best option at the moment.
Any ideas?