I have a master detail that can be compiled many times with two buttons: one to save infos, and one to undo the operation and close the panel without save it.
With the commandLink "Insert new" I show the panel and the two buttons setting the variables rendoquadro=true and rendopulsanti=true.
<a4j:commandLink value="Insert new" action="#{np_b.gestore_committenti.nuovo}" ajaxSingle="true" reRender="comm:quadro"/>
<rich:spacer height="12px" />
<f:subview id="comm">
<a4j:outputPanel id="quadro">
<rich:simpleTogglePanel switchType="client" rendered="#{np_b.first_committente.stato.rendoquadro}">
<h:panelGrid columns="3" >
<h:input id="denominazione" binding="#{np_b.first_committente.societa.denominazione}" required="true>
</h:input>
<h:input id="partitaiva" binding="#{np_b.first_committente.societa.partitaiva}" required="true">
</h:input>
<h:input id="codicefiscale" binding="#{np_b.first_committente.societa.codicefiscale}" required="true">
</h:input>
</h:panelGrid>
</rich:simpleTogglePanel>
</a4j:outputPanel>
</f:subview>
<h:panelGrid columns="2">
<a4j:commandButton value="Undo" reRender="committentilist,comm:quadro"
action="#{np_b.gestore_committenti.annulla}" rendered="#{np_b.first_committente.stato.rendopulsanti}"
immediate="true" type="submit">
</a4j:commandButton>
<a4j:commandButton value="Save" reRender="committentilist,comm:quadro"
action="#{np_b.gestore_committenti.salva}" rendered="#{np_b.first_committente.stato.rendopulsanti}"
type="submit">
</a4j:commandButton>
</h:panelGrid>Hi Alessandro,
Please take a look: http://ishabalov.blogspot.com/2007/08/sad-story-about-uiinput.html