File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Bean value doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Bean value doubt" Watch "Bean value doubt" New topic

Bean value doubt

Gopu Akraju
Ranch Hand

Joined: Jan 13, 2008
Posts: 242
I have a bean set in the first page.

And I am able to display the value when I navigate to the next page as below:

When I try to display this value in the third page as below:
, this value is NULL.

My bean scope in the faces.xml files is as below:

I can't change the scope as tehre are many beans in that class and have used usual getter and setter method. Please let me know how to display the UserBean.selectRun value in the third page?
Gopu Akraju
Ranch Hand

Joined: Jan 13, 2008
Posts: 242
I could do it by changing the scope to session from request.

But how to flush or reset the values and regain the original values if cancel button is pressed? Thanks.
[ September 18, 2008: Message edited by: Gopu Akraju ]
Sath Side

Joined: Sep 16, 2008
Posts: 4
If I correctly follow, can you just set UserBean.selectRun to the original value in the reset or cancel action in your backing bean?
Gopu Akraju
Ranch Hand

Joined: Jan 13, 2008
Posts: 242
Hi Thanks Sathe,
I could find a way to reset all the bean value by invalidating the session as below. Might be useful for others too and hence I am posting it.

I added these code under cancel command button. And it works fine by resetting the bean values.
I agree. Here's the link:
subject: Bean value doubt
It's not a secret anymore!