A solution to automatically synchronize the value of page items on different pages, that all use the same LOV.
Useful if you want the user to be able to choose a value for (in this example) Empno, and to keep using that same value when he/she switches to another page.
This example uses 2 pages (1071 and 1072). Both have a page item based on the EMP_LOV LOV, that submit the page on change.
The value of these page items is synchronized by an Application Item, and two Application Process on page 0.
You can add any number of pages with this same type of item. As long as you name it P_xxx_EMPNO_FROM_LOV, you won't have to add any code to those new pages to get this to work.
You can choose a value from the select list, and switch between the 2 pages by using the button above, to see the effect of this setup.
Note: For the example to work, you also need to define an Application Item named F_EMPNO (it is not listed in the Code section below).
Note: Make sure the Application Processes on page 0 have very low/high ID's, to ensure they always run before/after any page actions/processes; e.g. -999 and 999.
Previous (abandoned) solution:
A previous version of this solution used a Dynamic Action with a jQuery selector, instead of the After Page Submit process. This lead to problems with session timeouts however, so that approach was abandoned. Too bad really, it was quite elegant (and didn't require the page items to submit the page).
More info on the cause:
Bug 22924875 : FILE BROWSE BUTTON - JSON ERRORS FROM A DYNAMIC ACTION WHEN TIMEOUT IS REACHED
And still more info:
https://community.oracle.com/thread/3907873?start=0&tstart=0
"If the session times out (idle or otherwise) and you then perform any dynamic action requiring a trip to the database for PL/SQL (regardless of what its function is) - this will unfortunately produce a browser error.
Correct, at least with DA's. With self-performed ajax calls you could try to account for this, but with DA's you can't. And since those DA ajax calls expect a JSON return, the return of HTML text will cause a javascript error, since jQuery (since jQuery's $.ajax is being used) will attempt to parse the return to an object."