Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

back commandbutton in jsf

how would one implement a back-button as a commandbutton that works universally? with back button i don't mean the browser-button, but rather a button that sits somewhere on the page. it is not always possible to use the Post-redirect-get pattern.

its quite impractial to pass around the information on every single where the button should point to.

is there maybe a reserved keyword for a navigation rule that points to the last navigation rule applied?

like image 646
Andreas Petersson Avatar asked Mar 16 '09 10:03

Andreas Petersson


1 Answers

You can use:

<p:commandButton onclick="window.history.back();"/>

That instruction do the same as onclick="history.go(-1)" which alexmeia has said.

like image 59
Erick Alves Avatar answered Nov 15 '22 12:11

Erick Alves