I have a p:commandButton with an action attribute assigned located in a p:panelGroup which is conditionally rendered. The action method is not fired if I'm pressing the button.
If I remove the rendered attribute of the surrounding p:panelGroup (so it's always rendered) the action method is called. I don't want to assign a rendered attribute to every single element inside my form - I just want to show/hide the whole p:panelGroup. Is this possible? If yes, what can I do to get it working?
<h:panelGroup id="neues-verfahren-panelgroup" rendered="#{verfahrenTree.currentType.equals('neues-verfahren')}"
styleClass="form-container">
<h:form id="form-neues-verfahren">
<!-- form data goes here ... -->
<div class="form-row">
<p:commandButton id="form-neues-verfahren-speichern" action="#{verfahrenBean.neuesVerfahrenSpeichern}" value="Speichern" />
</div>
</h:form>
</h:panelGroup>
Edit (Solved): Changing the scope of the backing bean from request scoped to view scoped solved the problem.