This content has been marked as final.
Show 5 replies
-
1. Re: Using Ajax4JSF reRender inside a loop (ui:repeat or a4j:
damianharvey Nov 13, 2007 5:22 AM (in response to erik.d.hellman)Just put in a fixed id and JSF will generate a unique id. Ajax4jsf should respect it too. Try checking the generated ids with firebug (or page source).
-
2. Re: Using Ajax4JSF reRender inside a loop (ui:repeat or a4j:
erik.d.hellman Nov 13, 2007 5:32 AM (in response to erik.d.hellman)"damianharvey" wrote:
Just put in a fixed id and JSF will generate a unique id. Ajax4jsf should respect it too. Try checking the generated ids with firebug (or page source).
Tried that. Doesn't work. I changed reRender="dayTimeSum" and the id in my a4j:outputPanel to id="dayTimeSum". Same result, no update of the a4j:outputPanel. -
3. Re: Using Ajax4JSF reRender inside a loop (ui:repeat or a4j:
pmuir Nov 13, 2007 6:12 AM (in response to erik.d.hellman)No, you can't use a el expression for the id. Damian is correct.
-
4. Re: Using Ajax4JSF reRender inside a loop (ui:repeat or a4j:
erik.d.hellman Nov 13, 2007 7:28 AM (in response to erik.d.hellman)"pete.muir@jboss.org" wrote:
No, you can't use a el expression for the id. Damian is correct.
Well, I guessed that much. But how would I then go about in order to reRender an outputPanel genereated inside a ui:repeat? -
5. Re: Using Ajax4JSF reRender inside a loop (ui:repeat or a4j:
damianharvey Nov 13, 2007 10:29 AM (in response to erik.d.hellman)if you are re-rendering from inside the loop (like you are) then you shouldn't need to do anything:
<ui:repeat var="dayTime" value="#{planWorkBean.dayTimes}"> <h:selectOneMenu value="#{dayTime.workShift}"> <s:selectItems value="#{workShifts}" var="workShift" label="#{workShift.name}" noSelectionLabel="-" /> <s:convertEntity /> <a4j:support action="#{dayTime.setWorkShift(workShift)}" event="onchange" reRender="dayTimePanel" /> <h:selectOneMenu> <a4j:outputPanel id="dayTimePanel"> <h:outputText value="#{dayTime.workShift.totalTime}" converter="HourMinuteConverter" /> </a4j:outputPanel> </ui:repeat>
Note that the id is 'dayTimePanel'. When JSF renders this it will assign incrementing IDs (something like j_xx:1:dayTimePanel, j_xx:2:dayTimePanel, etc).
If you are rendering from outside the loop or if you are still having troubles look at the a4j:repeat instead of ui:repeat and check out the ajaxKeys attribute.
Cheers,
Damian.