My JSF template has a section that includes another page:
<p:outputPanel id="foo">
<ui:include src="#{bean.page}" />
</p:outputPanel>
bean.page
is set in the bean's @PostConstruct
method to default page a.xhtml ==> page a is loaded and everything behaves as expected.
Now, I set bean.page
to b.xhtml and update the <p:outputPanel id="foo">
==> page b is loaded but whenever I click on an <h:commandButton>
, its action-method is never called.
How to ajax-refresh dynamic include content by navigation menu? (JSF SPA) has an answer that says that any postback in an <ui:include>
page will fail, when the included page contains a <h:form>
; the reason is a missing view state. But when I click on the <h:commandButton>
and analyze the posted data with Firebug, I see that param javax.faces.ViewState with the right value was sent to the server. But anyway, the button's action-method is never invoked.