2 Replies Latest reply on May 9, 2007 5:40 AM by mglowacki

    reRender only part of components in a4j:repeat

    mglowacki

      Hi,

      I've got a table where only one component should be reRendered (valD)

      Tried to do something, but without success...

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


      Can anyone help? Any hints how it should be done?

      Michal

        • 1. Re: reRender only part of components in a4j:repeat

          try to specify rowKeys attribute for repeat

          • 2. Re: reRender only part of components in a4j:repeat
            mglowacki

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

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



            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++) {
             model.setRowIndex(i);
             row = (TempModel)model.getRowData();
             System.out.println("id: " + valDText.getId());
             list.add(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.