Hy all.Working with JSF 2.2.
I have two panelGrid rendered in base of a selection of oneselctmenu.
In the panels I want to put some form that should be executed with his ownn command button.
The problem is that when the panels are rendered the commandbutton inside doesn't do any action.
I know that the cause is due to the evalutation of rendered attribute to false,
as mentioned in this post :
[commandButton/commandLink/ajax action/listener method not invoked or input value not updated :
The rendered attribute of the component and all of the parent components should not evaluate to false during the apply request values phase of the form submit request.
I tried to bypass the problem adding a param to be evaltated as true in the desidered component, before the "apply request values phase", but it doesn't work. Can anybody help me to understad how achive my goal?
The bean is ViewScope.
I tried various configurations
<h:form id="azione0">
<h:selectOneMenu id="smenu0" value="#{bean.azione}">
<f:selectItems value="#{bean.azioni}" />
<f:ajax render=":panels " />
</h:selectOneMenu>
</h:form>
<!--This panel is corrected rendered, but the form dosen't work -->
<h:panelGroup id="panels" >
<h:form rendered="#{bean.azione eq 'A'}" >
<!-- If I execute this command(AJAX) then THE BEAN IS RECREATED -->
<h:commandButton value="Add New user- aajax"
action="#{bean.addnewUser}">
<f:ajax execute="@this" render="newuser" />
</h:commandButton>
<h:panelGroup id="newuser" rendered="#{bean.newuserinput}">
Myname
<h:inputText id="myname" value="#{bean.myname}" />
<h:commandButton action="#{bean.saveNewUser()}" value="save" >
<f:ajax execute="@form" render=":panels"/>
</h:commandButton>
</h:panelGroup>
</h:form>
</h:panelGroup>
Edit: I have modified the code after many test , and now it is syntetized to isolate the problem.