• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to populate values from one page to another

 
alisha chenna
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just create a backing bean in session scope.

Edit in your config.xml

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!