[jboss-user] [JBoss Seam] - Re: Using Ajax4JSF reRender inside a loop (ui:repeat or a4j:

damianharvey do-not-reply at jboss.com
Tue Nov 13 10:29:44 EST 2007


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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104182#4104182

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104182



More information about the jboss-user mailing list