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

erik.d.hellman@gmail.com do-not-reply at jboss.com
Tue Nov 13 05:02:43 EST 2007


I have a loop in my JSF page generated with ui:repeat. Inside that loop I have a h:selectOneMenu with a a4j:support side it. I also have a a4j:outputPanel inside the loop. My question is how I can make my selectOneMenu trigger a reRender of the correct a4j:outputPanel. I tried setting the id and reRender attributes of the a4j:outputPanel and a4j:support to the id of the entities I iterate over, but that doesn't work.

The code looks something like this:

<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="#{dayTime.id}" />
  |    <h:selectOneMenu>
  | 
  |    <a4j:outputPanel id="#{dayTime.id}">
  |       <h:outputText value="#{dayTime.workShift.totalTime}" converter="HourMinuteConverter" />
  |    </a4j:outputPanel> 
  | </ui:repeat>

Everything but the reRendering works great. The entity is updated at the onchange event, but the a4j:outputPanel is not updated.

I guess I can't use EL-expressions for the id-attribute in JSF-tags, but how else am I supposed to refer to the correct a4j:outputPanel?

Thanks,
Erik

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

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



More information about the jboss-user mailing list