Hi all,
I need to show a confirmation dialog after the user clicks on a button. The message that should appear on the confirmation dialog is returned by a PL/SQL function.
To accomplish this, I created a dynamic action that is fired every time the user clicks on the button and has three actions. I also created a hidden page item (P1_CONFIRM_MSG) to save the message.
1st Action
Action: Execute PL/SQL code
Stop Execution On Error: Yes
Wait For Result: Yes
PL/SQL code:
DECLARE
L_Msg VARCHAR2(4000);
BEGIN
L_Msg := MY_FUNCTION(:P1_MY_ITEM);
APEX_UTIL.SET_SESSION_STATE('P1_CONFIRM_MSG',L_Msg);
END;
Page Items to Submit: P1_MY_ITEM
Page Items to Return: P1_CONFIRM_MSG
2nd Action
Action: Confirm
Text: &P1_CONFIRM_MSG.
3rd Action
Action: Submit Page
However, the confirmation dialog it is not showing the message returned by the PL/SQL function. Instead, it is showing "null":

If I check the session state (click on "Session" at the bottom bar), I can see the page item (P1_CONFIRM_MSG) populated with the correct value, i.e., the confirmation message.
If I also create another action between the 1st action and the 2nd action to log the page item (P1_CONFIRM_MSG) value to the console, the value is correctly logged.
Action: Execute JavaScript code
Code:
console.log('P1_CONFIRM_MSG: ' + $v("P1_CONFIRM_MSG"));
Why am I not able to see the value on the confirmation dialog?
Thanks in advance.
smoliveira