0 Replies Latest reply on Aug 13, 2008 6:35 PM by gustavodelgado

    Problem with a4j:keepAlive

    gustavodelgado

      Hello,

      In some components that i need to dinamically change its properties, i use the binding to the same, so i set the propertie that i want on managed bean. But when use <a4j:keepAlive> to this managed bean, this operation stop to work, like the component didn't was rendered again. So the methods are normally executed.

      I will post a simple sample:

      <h:form>
       <a4j:keepAlive beanName="Login"/>
      
       <a4j:commandButton value="Mostra" action="#{Login.mostra}" ajaxSingle="true" reRender="grid1"/>
       <a4j:commandButton value="Oculta" action="#{Login.oculta}" ajaxSingle="true" reRender="grid1"/>
      
       <h:panelGrid id="grid1">
       <h:panelGrid id="grid2" binding="#{Login.grid2}">
       <h:outputText id="texto1" value="texto do grid"/>
       </h:panelGrid>
       </h:panelGrid>
      </h:form>



      I have 2 buttons and 2 methods to show or hidde "grid2". In managed bean I have:

       private HtmlPanelGrid grid2;
      
       public HtmlPanelGrid getGrid2() {
       return grid2;
       }
      
       public void setGrid2(HtmlPanelGrid grid2) {
       this.grid2 = grid2;
       }
      
      
      
       public void mostra(){
       grid2.setRendered(true);
       }
      
       public void oculta(){
       grid2.setRendered(false);
       }



      If i remove the keepAlive, it works fine, else, the component is not refreshed on the page.

      Thanks!