Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF Back Button [duplicate]

How do I make a link which navigates the user back one page (i.e. same as clicking browser back)?

Thanks.

like image 422
DD. Avatar asked Jan 24 '26 04:01

DD.


1 Answers

To the point: just remember the request URL or the JSF viewId of the previous page so that you can use it in the href or value of the output/commandlink. There are several ways to achieve it, depending on how you're actually navigating through the pages and how "jsfish" you want to achieve it. You could pass it as a request parameter by f:param in h:outputLink, or you could set it as a bean property by f:setPropertyActionListener in h:commandLink, or you could create a PhaseListener which remembers the viewId and make use of navigation cases, or you could grab the -much less reliable- JavaScript history.go() function.

like image 143
BalusC Avatar answered Jan 25 '26 20:01

BalusC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!