Go back to previous page when CANCEL pressed
3180Apr 9 2005 — edited Apr 9 2005My questions are at the bottom, but first I would like to explain(in detail !!) what I have done so far with it:
I am trying to implement the functionality where pressing CANCEL takes me back to the previous page I came from ( like the browser BACK button).
All the CANCEL buttons in my application have a Page redirect of &F119_PREV_PAGE_ID. where F119_PREV_PAGE_ID is my application level item having the previous page id.
I have done the following to implement this:-
1. Declared 2 application level items - F119_THIS_PAGE_ID and F119_PREV_PAGE_ID.
2. Declared 3 application level computations :-
1. SEQUENCE -> 1
ITEM -> F119_THIS_PAGE_ID
COMPUTATION POINT -> AFTER HEADER
COMPUTATION(SQL QUERY) -> SELECT :APP_PAGE_ID FROM DUAL WHERE :APP_PAGE_ID <> 101
CONDITION -> VALUE OF ITEM IN EXPRESSION 1 IS NULL->
EXPRESSION 1 -> F119_PREV_PAGE_ID
2. SEQUENCE -> 2
ITEM -> F119_PREV_PAGE_ID
COMPUTATION POINT -> AFTER HEADER
COMPUTATION(ITEM VALUE) -> F119_THIS_PAGE_ID
CONDITION -> NONE
3. SEQUENCE -> 3
ITEM -> F119_THIS_PAGE_ID
COMPUTATION POINT -> BEFORE REGION(S)
COMPUTATION(SQL QUERY) -> SELECT :APP_PAGE_ID FROM DUAL
CONDITION -> NONE
On login(page 101) ,the first computation fires and sets the value of F119_THIS_PAGE=NULL. Second computation sets F119_PREV_PAGE=NULL and then the third one makes F119_THIS_PAGE=101.
On Page 1 home page, first computation makes F119_THIS_PAGE_ID=1, second one set F119_PREV_PAGE_ID=1 and third one sets F119_THIS_PAGE_ID=1, which is what I want and everything from then on works fine but I get into trouble when I have a page having NEXT/PREVIOUS buttons or even if I submit a page by SAVING , the page submits itself and the 3 computations fire setting the F119_PREV_PAGE_ID=F119_THIS_PAGE_ID, and as a result clicking BACK keeps me on the same page itself.
I think to solve this problem I need to make my second computation conditional that it should only fire if F119_THIS_PAGE_ID<>:APP_PAGE_ID but all my efforts to provide a condition like this have failed.
Questions time :-
1. How do I access application level items like F119_THIS_PAGE_ID in pl/sql ? I tried F119_THIS_PAGE_ID,:F119_THIS_PAGE_ID,&F119_THIS_PAGE_ID. but all failed.
2.How to set a condition for computation#2 that it should only fire if F119_THIS_PAGE_ID <> :APP_PAGE_ID. I tried expression 1 <> expression 2, current page <> expression 1 but nothing seems to be working
3. Lastly, is this the best or the only way of doing something like this, any suggestions ?
thanks in advance