users@glassfish.java.net

Why does _at_ViewScoped not work?

From: <glassfish_at_javadesktop.org>
Date: Sat, 18 Sep 2010 08:48:05 PDT

I have a backing bean for a new user registration form, and I use <f:ajax> to interact with the user. So this means the backing bean has to carry the state of what is currently selected until the user hits the go button.

So the bean is annotated @java.faces.bean.ViewScoped and @javax.enterprise.inject.Model.

For a few cycles of user interaction, the bean stays persistent, then for some reason it is discarded and a new one is instantiated, throwing all the state away. I can make the problem go away by going to SessionScoped, but that seems like a poor solution.

Do I misunderstand what @ViewScoped is supposed to do? I can't find any formal description other than "as long as the user stays on the view" the managed beans in the view scope are supposed to stay there. If this seems wrong, how do I go about trying to debug this?
[Message sent by forum member 'alan94539']

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