7 Replies Latest reply on Apr 5, 2007 1:55 PM by James Hays

    a4j:repeat component - rerendering problem

    confuzius Newbie

      Hi,

      I'm using Jsf 1.2 RI along with a4j version 1.1.0 and have some troubles concerning the a4j:repeat component. I want to render some data contained in a list, which works fine so long. But when the user deletes one object (e.g. the first one) in the list, rerendering the objects doesn't work correctly: there's one object fewer, but it is always the last one in the list that isn't shown (which is not according to the backing bean where the data comes from). Has anyone a solution to this problem?

      Tia,
      Hannes

      The code looks like follows:

      <h:panelGroup id="personPanel" >
      
      <a4j:repeat value="#{personHandler.iterationList}" var="it">
       <h:panelGroup layout="none">
       <p>
       <h:outputLabel value="#{msg.person}" styleClass="label longLabel" />
       <h:selectOneMenu value="#{personHandler.persons[it].person}"
       converter="#{sessionHandler.personConverter}" >
       <f:selectItems value="#{sessionHandler.personItems}"/>
       <a4j:support event="onchange" ajaxSingle="true" limitToList="true"
       actionListener="#{speechHandler.changed}"
       ignoreDupResponses="true" />
       </h:selectOneMenu>
       <h:outputLabel value="#{msg.share} *" for="personPercent"
       styleClass="longLabel"/>
       <h:inputText id="personPercent" value="#{personHandler.persons[it].percentage}"
       required="#{speechHandler.saveMethod}" maxlength="6" size="4">
       <f:converter converterId="percentageConverter" />
       <f:validator validatorId="percentageValidator" />
       <a4j:support event="onkeyup" ajaxSingle="true" limitToList="true"
       actionListener="#{speechHandler.changed}"
       ignoreDupResponses="true"/>
       </h:inputText>
       <h:outputLabel value="#{msg.delete}" for="deleteCheckBox"/>
       <h:selectBooleanCheckbox id="deleteCheckBox"
       value="#{personHandler.toDelete[it]}" immediate="true"/>
       <h:message errorClass="error" for="personPercent"/>
       </p>
       </h:panelGroup>
      </a4j:repeat>
      </h:panelGroup>
      
      <p>
       <a4j:commandButton id="buttonMoreSpeechPerson" styleClass="button" value="#{msg.more}"
       actionListener="#{personHandler.more}" reRender="personPanel" />
      
       <a4j:commandButton id="buttonDeleteSpeechPerson" styleClass="button" value="#{msg.delete}"
       actionListener="#{personHandler.delete}" reRender="personPanel" />
      </p>