Written by Paulo Vale on Sunday, February 17, 2008
When developing an application we must provide intuitive navigation. When a user enters a page and it's presented with "Cancel" button, clicking this button should redirect the user to the page he came from. To achieve this, we can create a branch referring a page number. However, fixing a page number isn´t the best solution because the origin page can be variable.
I've tested some solutions using javascript:history.back() or decoding the referrer url using owa_util.get_cgi_env('HTTP_REFERER') among others, but ended with a self made solution. This solution consists in having an PL/SQL application process executed "On Load Before "Body" Region(s)" updating an application item wich stores the last page visited by the user.
So let me elaborate, step by step:
1- Create two application items.
2- Create a PL/SQL application process.
Code:
3- Go to you page and edit the branch linked to the CANCEL or SUBMIT button.
That´s it. Please feel free to comment or add an alternative solution.