voyent
Icefaces 2 View scope problem  XML
Forum Index -> General Help
Author Message
sparky_20

Joined: 07/Jan/2010 00:00:00
Messages: 19
Offline


Hello,

I have migrated an application from IceFaces 1.8 to Icefaces 2 and i am facing a lot of problems.

I have been relying a lot on the behavior of the old request scope (behaviour that reloaded a bean on refresh but didn't reload the bean on an action like the ones from ice:commandLink), but now with the view scope my logic is messed up a lot.

The problem: the view scope recreates the bean every time i click an ice:commandLink component, which is awfull for me.

The window scope provided by icefaces doesn't help either because i don't want the bean to survive a refresh.

Any help will be greatlly apreciated!
Unvirtual

Joined: 02/Jan/2009 00:00:00
Messages: 151
Offline


Hi,

you could integrate seam 3 faces module into your project and try it with their view scope implementation. When I'm correct it will work with that. May the @FlashScope would be also better.

Florian
sparky_20

Joined: 07/Jan/2010 00:00:00
Messages: 19
Offline


I discovered what the problem was: The view scope behaves as i needed, but when you have binding in your page, the bean reloads, i don't know why.

Now i am trying to find a replacement for the binding.
judy.guglielmin

Joined: 20/Feb/2007 00:00:00
Messages: 1396
Offline


the component binding with jsf only works in session scope for the way you were using in jsf1.2

Please see the following jira for a way to use component binding with jsf2.0 (this has to do with component binding and jsf 2)

http://jira.icefaces.org/browse/ICE-5226
dwight

Joined: 13/Oct/2008 00:00:00
Messages: 81
Offline


It would be good if this issue were mentioned on one or more of the compatibility / migration pages, such as http://www.icesoft.org/wiki/display/ICE/ICEfaces+1.x+Compatibility or http://www.icesoft.org/wiki/display/ICE/Converting+ICEfaces+1.8+Applications+to+ICEfaces+3

The other item that breaks View scope is using c:forEach or c:if with expressions referring to the bean in question. This is a JSF bug, supposed to be fixed in JSF 2.2 -- see http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-928

The migration from 1.8.2 to 3.2 is tough enough, without having to "rediscover" each of these issues individually.
dsinotte

Joined: 14/Nov/2006 00:00:00
Messages: 33
Offline


Thanks for your feedback. I've added a note to the pages you pointed out:

http://www.icesoft.org/wiki/display/ICE/ICEfaces+1.x+Compatibility
http://www.icesoft.org/wiki/display/ICE/Converting+ICEfaces+1.8+Applications+to+ICEfaces+3

that indicates the potential pitfalls with @ViewScoped beans.
dwight

Joined: 13/Oct/2008 00:00:00
Messages: 81
Offline


Thanks!

It appears that there is now a fix for this -- JSF 2.1.18. I've been testing this new release with my application, and it appears to fix the View scope problem regarding both binding on components and c:forEach or c:if that have bean references. With JSF 2.1.17, my View-scoped bean was getting instantiated on each request, but with 2.1.18, it is only instantiated upon opening the page.

The jar file is available at http://mvnrepository.com/artifact/org.glassfish/javax.faces/2.1.18
dsinotte

Joined: 14/Nov/2006 00:00:00
Messages: 33
Offline


Good to know. I did read something to that effect in one of the JSF JIRA but haven't had a chance to test it so thank you for confirming. I did make a note about it possibly being fixed in JSF 2.1 but I'll update it to be more specific.

Our next release will be going out with official support for JSF 2.1.18+ so hopefully this won't be an issue going forward.
dwight

Joined: 13/Oct/2008 00:00:00
Messages: 81
Offline


oh, in case you're referring to the post in http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-928 on 22/feb/13, that's from me! But hopefully someone else will be able to confirm it!

Good news about the next release.
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team