jQuery in Action, 2nd edition*
The moose likes JSF and the fly likes JSF request parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF request parameters" Watch "JSF request parameters" New topic
Author

JSF request parameters

Pradyut Bhattacharya
Ranch Hand

Joined: Aug 12, 2004
Posts: 63
Hi
I want to get the value of a text field "textField1" in a Page1
Im able to forward to Page2 via a button but I want to retrieve the value of textfield in page2

The code i wrote in prerender function is: -
label1.setText(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("Page1.textField1"));

where label1 is a label in Page2
but I do not get any value in Label1.

Any Help

Thanks
Pradyut
http://pradyut.tk
India


Pradyut
http://pradyut.tk/
A. Dusi
Ranch Hand

Joined: Sep 27, 2004
Posts: 114
What is the scope of your backing bean for Page1? If it is in session scope, you can simply access the textfield in Page2 the same way you are accessing it on Page1.
If the scope is request and if you are using MyFaces implementation, check out the t:saveState tag on MyFaces Wiki page.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSF request parameters