3 Replies Latest reply on May 9, 2007 5:41 AM by Michal Glowacki

    how to get  dynamic values for reRender in a4j

    meena k Newbie

      In one of our pages we have around six textareas and we have to reRender only the textareas where the text is entered when we click on the command link .
      So i need to get the list of the ids that should be reRendered dynamically.

      here is the sample code :

      <h:inputTextarea id="man_comm1" value="#{emp.empstate.comment3}" disabled="#{focal.edit3}" rendered="#{emp.empstate.rencom3}" rows="5" cols="40"/>

      <h:inputTextarea id="man_comm2" value="#{emp.empstate.prevComment3}" rows="5" cols="40" rendered="#{emp.empstate.rencom3}" readonly="true"/>

      <a4j:commandLink styleClass="button" reRender="#{emp.empstate.ren}" action="#{emp.empstate.updatecomments}">
      <h:graphicImage value="/images/button_update.jpg" styleClass="button" />
      <f:param name="sid" value="#{emp.empstate.model.employee.personSeqId}"/>


      Thank you in advance

        • 1. Re: how to get  dynamic values for reRender in a4j
          Sergey Smirnov Master

          I am not sure I understand the question right. Yes, you can use EL in the reRender and assign the value anywhere prior the RENDER RESPONSE phase.
          The potential problem I see in your code is not about the reRender itself, but about rendered attribute on the textarea.
          Try to avoid pointing with reRender to the components that has 'rendered' attribute. As an alternative, you can surround such component with < a4j: outputpanel layout="none" >

          • 2. Re: how to get  dynamic values for reRender in a4j
            Michal Glowacki Novice

            Sorry, I don't get it. I've tried:

             <a4j:poll action="#{bean.updateStats2}" immediate="true" interval="5000" reRender="gamesRow"/>
             <a4j:repeat binding="#{bean.gamesRepeat}" id="gamesRow" value="#{bean.gamesIt}" var="games_it" ajaxKeys="#{bean.ajaxedRowsSet}">
             <h:panelGrid columns="2">
             <h:outputText id="valA" value="#{games_it.valA}"/>
             <h:outputText id="valB" value="#{games_it.valB}"/>
             <h:outputText id="valC" value="#{games_it.valC}"/>
             <h:outputText binding="#{bean.valDText}" id="valDText" value="#{games_it.valD}"/>

            public List ajaxedRowsSet() {
             ListDataModel model = (ListDataModel)gamesRepeat.getValue();
             TempModel row = null;
             int rows = model.getRowCount();
             List list = new ArrayList();
             for(int i=0;i<rows;i++) {
             row = (TempModel)model.getRowData();
             System.out.println("id: " + valDText.getId());
             return list;

            buit nothing happens. And Log4j shows this error

            error[10:53:38,250]: New node for ID main:gamesRow is not present in response

            Looks like method for getting ids is not even invoked.

            • 3. Re: how to get  dynamic values for reRender in a4j
              Michal Glowacki Novice

              sorry, I have posted my message in wrong thread... ;)