2 Replies Latest reply on Dec 5, 2008 9:25 AM by joodie

    Hidden or not a component

    six-p4ck

      Hello, i have a question, i hope you can help me:

      Can i reRender a no-rich component?

      I try it but it's doesn't like work.

      I want display the first panelGrid or the second (but never twice in same time).
      I d'like too use a commandLink for swap the display.

      JSF:

      <f:view>
       <h:form>
       <h:panelGrid rendered="#{pc_Test.display1}" id="grid1" columns="2">
       <h:outputText value="Begin date: " />
       <rich:calendar />
       <h:outputText value="End date: " />
       <rich:calendar />
       </h:panelGrid>
      
       <h:panelGrid rendered="#{pc_Test.display2}" id="grid2" columns="2">
       <h:outputText value="Sending type: " />
       <h:outputText value="Sending type2: " />
       </h:panelGrid>
      
       <a4j:commandLink id="changeDisplayUrl" value="go select type" action="#{pc_Test.swap}" reRender="changeDisplayUrl,grid1,grid2" />
       </h:form>
      </f:view>



      Bean:
      protected Boolean display1 = true;
       protected Boolean display2 = false;
      
       public void swap() {
       if (getDisplay1() == true) {
       setDisplay1(false);
       setDisplay1(true);
       getChangeDisplayUrl().setValue("go time select");
       } else {
       setDisplay1(true);
       setDisplay1(false);
       getChangeDisplayUrl().setValue("go select type");
       }
       }
      


      he call the swap function, set the boolen, but my display never change