DBA Hub

📋Steps in this guide1/4

APEX Tips : Return a Value From a Modal Dialog

A quick tip to remind myself how to return a value from a modal dialog.

oracle miscconfigurationintermediate
by OracleDba
17 views
1

Requirement

We have two pages. - Source Page : A normal page with a Text Field called and a button called . - Modal Dialog : A modal dialog with a Text Field called and a button called . We need the following behaviour. - On the Source Page, when we click the button we want to open the Modal Dialog. - On the Modal Dialog, when we click the button we want to pass the value of the item back to the item.
2

Modal Dialog Setup

- Create a Dynamic Action on the button with the following settings. Name: onClick CloseDialog (amend as required) Event: Click Selection Type: Button Button: - Name: onClick CloseDialog (amend as required) - Event: Click - Selection Type: Button - Button: - The "Behaviour" setting of the button should now default to "Defined by Dynamic Action". - Edit the default True action as follows. Action: CloseDialog Items to Return: - Action: CloseDialog - Items to Return:
3

Source Page Setup

- The button should have the following "Behaviour" settings. Action: Redirect to Page in this Application. Target: Page 3. In this example we aren't passing any values, but we will set the "Clear Cache" attribute to page "3" in the "Link Builder - Target" popup. - Action: Redirect to Page in this Application. - Target: Page 3. In this example we aren't passing any values, but we will set the "Clear Cache" attribute to page "3" in the "Link Builder - Target" popup. - Create a Dynamic Action on the button with the following settings. Name: DialogClosed (amend as required) Event: Dialog Closed Selection Type: Button Button: - Name: DialogClosed (amend as required) - Event: Dialog Closed - Selection Type: Button - Button: - Edit the default True action as follows. Action: SetValue Set Type: Dialog Return Item Return Item: Selection Type: Item(s) Item(s): - Action: SetValue - Set Type: Dialog Return Item - Return Item: - Selection Type: Item(s) - Item(s):
4

Test It

It should now work as required. For more information see: - APEX Articles - Passing Data in and out of APEX Dialogs Hope this helps. Regards Tim...

Comments (0)

Please to add comments

No comments yet. Be the first to comment!