webtier@glassfish.java.net

Re: [webtier] Using ui:include with View Scoped beans

From: <webtier_at_javadesktop.org>
Date: Mon, 15 Feb 2010 16:12:41 PST

I tried a variety of methods.

I tried using a view scoped bean and trying to obtain a UIComponent off it using something like:

<ui:component binding="#{MyViewScopedBean.someComponent}"/>

But, as in the original case, the #{MyViewScopedBean.someComponent} expression is evaluated before the view scope is restored (because it is evaluated as part of the restoreView process) so, every page load, a new instance of MyViewScopedBean is created.

I have resigned to the fact that View scopes in JSF 2.0 are somewhat useless for what I am trying to do for as long as the scope is restored after the component tree has been rebuilt. I can see exactly where it is happening in the code in JSF, it seems a little silly as to where it is occurring, however I really don't know what the implications are if it was to change.
[Message sent by forum member 'mdergacz' (marc_at_skytix.com.au)]

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