webtier@glassfish.java.net

Jsf 2 : partial state saving breaks conditional ui:include

From: <webtier_at_javadesktop.org>
Date: Sat, 05 Dec 2009 13:02:44 PST

Hi,

I found out that it's impossible to rerender conditional ui:include in case if partial state saving feature was turned on.
Code example:

<h:commandLink>
<f:ajax render="out" listener="#{bean.changeCondition}"/>
</h:commandLink>

<h:panelGroup id="out" ...>
<ui:include src="#{bean.condition ? 'page1.xhtml' : 'page2.xhtml'}" />
</h:panelGroup>

Actual behavior: included page is changed with 1 request delay and does not consist to actual server condition value.
It happens because Facelets creates components tree on the first phase in case of partial state saving.
Is it possible to apply any workaround to fire it?

Thanks in advance.
[Message sent by forum member 'amarkavtsov' ]

http://forums.java.net/jive/thread.jspa?messageID=374944