I have a cancel button on a page.
But this page can be opened from different places. I mean the parent page can vary.
Now, by clicking on the cancel button I need to go back to the exact page where I came from – like history.back().
How can we implement it in JSF?
Can someone please guide me?
And that history.back() directly is not working.
<h:commandButton type="button" id="cancel" image="#{sessionScope.sessionObject.graphicImageFolderName}cancel_btn.gif" accesskey="#{bundle.oscer_command_cancel_accesskey}" value="Cancel" action="#{templatePrescriptionMaintenanceBackingBean.goBack}" />
In case of history.back() I am making the same button as..
<h:commandButton type="button" id="cancel" image="#{sessionScope.sessionObject.graphicImageFolderName}cancel_btn.gif" accesskey="#{bundle.oscer_command_cancel_accesskey}" value="Cancel" onclick="javascript: history.back();"/>
Is there anything wrong in both of the cases?
Try
Or
work for you?