2 Replies Latest reply on Jul 10, 2010 4:03 AM by vijayrajan1980

    Dynamically created element rendering problems

    vijayrajan1980

      We are creating dynamic tab components for assoiation.  In case we need to have another association tab, we use a modal panel as shown below in figure 2.  The problem we are facing is that, the data we have entered in the two other tabs is lost when we add another tab.  Is there a way around it??

       

       

      localhost screen capture 2010-6-25-17-34-17.png

      Figure 1

       

      localhost screen capture 2010-6-25-17-34-56.png

       

      Figure 2

       

       

      The code is as follows

       

      <rich:tab label="Association">

       

                   <a4j:outputPanel id="a4jAssociationTabs">

                   <rich:tabPanel  rendered="#{not empty customerEntry.associationList}" switchType="client">

                      <c:forEach items="#{customerEntry.associationList}" var="association">

                          <rich:tab rendered="#{association.rendered}">

                             ............

                               ..................

       

                          </rich:tab>

                      </c:forEach>

                      <rich:tab>

                           <f:facet name="label">   //The add button

                               <h:panelGroup>

                                   <h:graphicImage value="/images/icons/add.png"

                                      style="width:12px; height:12px;" />

                                      <rich:componentControl for="modPanAssociation" operation="show" event="onclick"/>

                               </h:panelGroup>

                            </f:facet>

                        </rich:tab>

                  </rich:tabPanel>

       

      <rich:modalPanel id="modPanAssociation" width="150" height="250" resizeable="false">//the modal panel
         
           <f:facet name="header">
                  <h:panelGroup>
                      <h:outputText value="Select Association"></h:outputText>
                  </h:panelGroup>
              </f:facet>
              <f:facet name="controls">
                  <h:panelGroup>
                      <h:graphicImage value="/images/icons/close.png" id="hidelinkAssociation" />
                      <rich:componentControl for="modPanAssociation" attachTo="hidelinkAssociation" operation="hide" event="onclick"/>
                  </h:panelGroup>
              </f:facet>
             <a4j:form>
              <c:forEach items="#{customerEntry.associationList}" var="association">
                  <h:selectBooleanCheckbox value="#{association.rendered}" disabled="#{not association.removable}"/>
                  <h:outputLabel value="#{association.name}" />
                  <f:verbatim> <br /> <br /></f:verbatim>
              </c:forEach>
            
              <a4j:commandButton  value="ADD" 
              oncomplete="Richfaces.hideModalPanel('modPanAssociation')"
              reRender="a4jAssociationTabs" limitToList="true"/>
              </a4j:form>
          </rich:modalPanel>