This week's book giveaway is in the JDBC forum.
We're giving away four copies of SQL Antipatterns: Avoiding the Pitfalls of Database Programming and have Bill Karwin on-line!
See this thread for details.
The moose likes JSF and the fly likes how to populate values from one page to another The Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "how to populate values from one page to another " Watch "how to populate values from one page to another " New topic
Author

how to populate values from one page to another

alisha chenna
Greenhorn

Joined: May 01, 2007
Posts: 7
Hi,

I am new to jsf. I need to populate the values from my first jsf page into the other page when i click the next button. I have tried a couple of things but no luck. Can anybody help me with this.

Thanks.
Daniel Conner
Ranch Hand

Joined: Jan 25, 2007
Posts: 47
have you tried putting it in the session?
Object myObject = ?(whatever it actually equals)
FacesContext context = FacesContext.getCurrentInstance();
Map sessionMap = context.getExternalContext().getSessionMap();
sessionMap.put("nameOfMySessionVariable", myObject);


AND then in the the bean where you want to get it:

FacesContext context = FacesContext.getCurrentInstance();
Map sessionMap = context.getExternalContext().getSessionMap();
Object myObject = (Object)sessionMap.get("nameOfMySessionVariable");
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 891
Just create a backing bean in session scope.

Edit in your config.xml


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
 
aspose file troubles
 
subject: how to populate values from one page to another
 
aspose file troubles