This content has been marked as final.
Show 2 replies
-
1. Re: Internal Workings of the Ajax4Jsf/Richfaces
nbelaevski Oct 21, 2008 6:28 PM (in response to speleomaniac)Hi,
There's a special a4j:repeat component developed for correct processing of ajax requests. All AJAX iteration components have ajaxKeys attributes that allows to define a Set of row keys (keys are numbers for sequence components like repeat or dataTable) for which re-rendering will be done.
Compare:<a4j:repeat ajaxKeys="#{forum5Bean.keys}" value="#{forum5Bean.data}"> <h:panelGroup id="group" layout="block" style="color: black"> <h:outputText value="#{forum5Bean.time}" /> </h:panelGroup> </a4j:repeat> <h:form> <a4j:poll reRender="group" interval="2000"></a4j:poll> </h:form>
1. Define rows to be re-rendered:public class Forum5Bean {... public Set getKeys() { HashSet set = new HashSet(); set.add(3); set.add(5); return set; } ... }
or 2. re-render all of them:public class Forum5Bean {... public Set getKeys() { return null; } ... }
See: org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(FacesContext, UIComponent, String, Set, Set), org.ajax4jsf.component.AjaxViewRoot and org.ajax4jsf.component.UIDataAdaptor.encodeAjaxChild(FacesContext, String, Set, Set) for more implementation details.I have a feeling Ajax4Jsf/Richfaces following another direction, instead of going all the JSF Lifecycle and all the components under the view root ,they are only concentrating to the component defined under the rerender panels....
In fact, all components are processed on 1-5 phase except for the case when a4j:region component or ajaxSingle/process attributes are used. On the 6th phase the whole component tree is searched for components to re-render too. -
2. Re: Internal Workings of the Ajax4Jsf/Richfaces
speleomaniac Oct 22, 2008 2:59 AM (in response to speleomaniac)In fact, all components are processed on 1-5 phase except for the case when a4j:region component or ajaxSingle/process attributes are used. On the 6th phase the whole component tree is searched for components to re-render too.
So I am right about my guess that Ajax4Jsf/Richfaces search explicitly in Phase 6 (Render I assume) the components tag to be rerendered only...and only process them.....
Thx for the answer and tips...