This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes Going back to the previous page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Going back to the previous page" Watch "Going back to the previous page" New topic
Author

Going back to the previous page

Ramesh Etta
Ranch Hand

Joined: Sep 18, 2007
Posts: 46
hi,

I want to place a BACK button in my jsf page that will take to the previous page what i had viewed.

Is there any tags or code that will do this.
please send me the code or an example

Thanks and Regards
Alberto Dousdebes
Greenhorn

Joined: Sep 02, 2008
Posts: 22
U can use a navigation case. In faces-config define a new one.

page 1 <------- "back" ------------ page 2

bye!
Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

You can simply use javascript for this. history.forward(-1)

Please google it I m not sure about this. Give this on onclick event.


My Blog SCJP 5 SCWCD 5
Ketan Jambhekar
Ranch Hand

Joined: Mar 26, 2007
Posts: 37
You can try with the UIViewRoot object.
You can store the UIViewRoot for the first page in a variable and then try setting it again in Context when the back button is called.
Once set you can call the renderResponse from Context.

To get the UIViewRoot :


when back button is called :





Thanks,
Ketan.
a phil
Greenhorn

Joined: Nov 11, 2008
Posts: 9
Hi ketan,

that was a simple and sweet trick. i liked it.
Ramesh Etta
Ranch Hand

Joined: Sep 18, 2007
Posts: 46
Thanks for your reply.
My requirement is i am calling a jsp from a subView and in the called jsp i need to place the back button which will take to the subView which is previews before.

I know to set the viewId, but how to set the subViewId.

Please reply, as it is an urgent requirement.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Going back to the previous page
 
Similar Threads
Which one Get or Post?
Question about back button in browser
log-out problem
history.back problem
Go back to previous page