1 Reply Latest reply on Jan 26, 2008 12:45 AM by Ariel Fernando

    reRender when ID is generated (variable)

    Daniel Kane Novice

      Hello colleagues,

      I have tabPanel where tabs are generated with c:forEach .
      On each tab I have rich:panelBar generated with c:forEach too.
      panelBarItems contains AJAX panels with forms .
      After form submission, I heed to reRender only current panelBarItem.
      Is it possible via Richfaces or/and plain Javascript ?
      Actually I need to rerender parent element of a:commandButton.

      I guess this is not the first question about dynamic IDs and rerendering, but were unable to find answers.

      Thank you in advance for all ideas !

        • 1. Re: reRender when ID is generated (variable)
          Ariel Fernando Newbie

          I have a similar problem....

          Situation:

          I have 2 tabPanel, one with "reRender = true" and the other with "reRender = false".
          First tabPanel have 2 tabs: "Query" and "Results". At firs tab, I put a button which reRender result dataTable located on second tab. This table show query results.

          This works fine, but.... at result dataTable I have a column "Edit" for each row with an actionListener that's try to reRender both tabPanel to change "render" attribute...and this do not work. ActionListener method is never called.
          If I put a4j:commandLink "Edit" outside dataTable, visible at begin, when table is empty because Search button is not presed (only for test) this works fine...

          My test case:


          <a4j:outputPanel id="idPanel">

          <rich:tabPanel switchType="client" rendered="#{!editSolicitudTrademark.edicion}">

          <rich:tab label="Query" >
          <h:form id="form">
          <h:panelGrid columns="1">
          <a4j:commandButton value="#{tag.btnSearch}" actionListener="#{searchFiles.searchAll}" styleClass="button" reRender="idResultTable"/>
          </h:panelGrid>
          </h:form>
          </rich:tab>

          <rich:tab label="Result">
          <h:form id="idFormResultado">
          <rich:dataTable id="idResultTable" value="#{searchFiles.solicitudes}"
          var="solicitud">
          <rich:column id="idAccion" width="100">
          <a4j:commandLink value="Edit" actionListener="#{editSolicitudTrademark.startEdition}"
          reRender="idPanel" ajaxSingle="true">
          </a4j:commandLink>
          </rich:column>
          </rich:dataTable>
          </h:form>
          </rich:tab>

          </rich:tabPanel>

          <rich:tabPanel id="idEdit" height="430px" switchType="client"
          rendered="#{editSolicitudTrademark.edicion}" selectedTab="id">
          <rich:tab label="TAB 1"></rich:tab>
          <rich:tab label="TAB 2"></rich:tab>
          <rich:tab label="TAB 3"></rich:tab>
          </rich:tabPanel>

          </a4j:outputPanel>


          (In my case, I try to do that when the user press "edit", query tabPanel set "render = false" and second tabPanel change to "render = true".)

          Best regards,