Apex version 19.1
I have seen numerous posts with this question but I get confused with so many seemingly different answers and I'm also not sure if they are Apex version specific. I would prefer a non-java script solution but I can copy and paste with the best of them if I get very specific instructions.
I need to link to a modal page from several different pages. Different pages will pass different page items as parameters. I have successfully, on other pages, linked to the modal page passing page items as parameters as these page items were populated when the page loaded. On the page I am working on now, the page items that I want to pass are entered onto the page during runtime and I want to pass the entered values.
I believe the pertinent issues are:
Linking to a modal page
Passing page item values that have changed after the page is loaded
I tried to make the behavior of the button "Redirect to page in this application". I believe because of the page item changed after the page is loaded, the current value of the page item is never passed. I have tried putting these page items into session state but I could never get it to pass the current value of the page items.
I then tried to use APEX_UTIL.PREPARE_URL as follows:
================
V_ITEMS := 'P24_HEADING_OR_LINE,P24_CONFIG,P24_HEAD_ID,P24_DIM_PART_TYPE,P24_DIM_PART,P24_DOOR,P24_MIN_HEIGHT,P24_MIN_WIDTH';
V_VALUES := 'L,'||:P31_PCN||','||:P31_HID||','||V_PART_TYPE||','||V_PART||','||:P31_DOOR||','||:P31_STD_HEIGHT||','||:P31_STD_WIDTH;
V_DIM_URL := APEX_UTIL.PREPARE_URL ( P_URL => 'f?p='||V('APP_ID')||':24:'||V('APP_SESSION')||'::NO::'||V_ITEMS||':'||V_VALUES,
P_URL_CHARSET => NULL,
P_CHECKSUM_TYPE => 'SESSION',
P_TRIGGERING_ELEMENT => '#dimension',
P_PLAIN_URL => TRUE );
APEX_UTIL.SET_SESSION_STATE ( 'P31_DIM_URL', V_DIM_URL );
========================
I set button ( static id dimension ) behavior to "Redirect to URL" as the target URL I have tried to use the above defined page item with the URL "&P31_DIM_URL."
This did not work at first, in an effort to see if my URL was correct, I copied the contents of P31_DIM_URL and pasted into the Target URL on the button and it worked. I changed the TARGET URL back to "&P31_DIM_URL." and it continued to work. I thought I had the problem solved until the next day when I tried again and it was broken again. The behavior that occurs when the dimension button is pressed is the page seems to refresh the page and does not transfer to the modal page.
I am hopeful that one of the above non java script solutions might work but I'd be willing to try using a java script solution but from looking at other posts, I'm not even sure where I am to put the java script. I think branching to the modal may work but as the modal is called from different pages I don't want to have to reprogram those pages to be consistent.
There is a chance that I may be able upgrade to a newer version if this is a bug or if newer versions solve this problem.
Thank you in advance.