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>
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); }