Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Confirmation Dialog don't display the value of substitution string

smoliveiraFeb 23 2016 — edited Feb 23 2016

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":

pastedImage_40.png

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

This post has been answered by fac586 on Feb 23 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 22 2016
Added on Feb 23 2016
1 comment
750 views