Suppose you have an editable page item, and you want to open a Modal Dialog where you then want to use the value of that page item (and return the edited value).
Since you need to set the session state of that item before opening the Modal Dialog, you cannot use a simple Redirect.
This can be done, but you need some Dynamic Actions and a page item to store the URL of the Modal Dialog.
Demo:
- Edit the value of Text (P1205_TEXT) on this page.
- Click on the Open Modal P1202 button.
- The DA Open Modal P1202 dynamic action sets the value of P1202_TEXT to the (edited) value of P1205_TEXT. Note that you could add this item to the URL which is generated in the next step, but then you would run the risk that the value is too long for the URL and will be truncated.
- The DA Open Modal P1202 dynamic action then sets the value of P1205_MODAL_P1202_URL to a URL for the modal page. Note the use of p_triggering_element which is set to the HTML DOM ID of the Open Modal P1202 button. Also note the values for Items to Submit and Items to Return.
- The DA Open Modal P1202 dynamic action then executes apex.navigation.redirect to open the modal page, using the URL stored in P1205_MODAL_P1202_URL.
- Edit the value of Text (P1202_TEXT) on the modal page.
- Click Save on the modal page, which submits the modal page.
- The page process Close Dialog on page 1202 closes the dialog, and returns the value of item P1202_TEXT.
- The DA Dialog Closed dynamic action then puts the value of P1202_TEXT into P1205_TEXT. Note the jQuery Selector which is set to the HTML DOM ID of the Open Modal P1202 button.