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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Pass client side state to modal dialog

Dietmar AustMay 21 2015 — edited Jul 1 2015

Hi guys,

I would like to open a modal dialog and pass the value of a select list to the modal dialog. I need to be able to pass the value from client state using apex.item("P1_DEPTNO").getValue(). The declarative way to use modal dialogs is to use a button and a page link, where everything is taken care of for us, the value, the checksum for session state protection, etc.

But sometimes we need to pass the current client side state to the modal page, e.g. when we are in the middle of creating a new row in a table ... and the value is not stored yet in the database.

So how can we do this? Passing variables from the current page and also generating the proper checksums for the items to be passed.

Since there is no dynamic action to do this directly, I have tried to attach a dynamic action to a button and run javascript to open the dialog (https://docs.oracle.com/cd/E59726_01/doc.50/e39149/javascript_api.htm#AEAPI29504) :

var l_url="f?p="+$v("pFlowId")+":2:"+$v("pInstance")+"::::P2_DEPTNO:"+apex.item("P1_DEPTNO").getValue();

alert (l_url);

apex.navigation.dialog(l_url, {

    title:'About',

    height:'480',

    width:'800',

    maxWidth:'1200',

    modal:true,

    resizable:false },

    '',

    $('#EMP_REPORT'));

 

Unfortunately, I get an error an internal error:

Application 157 Dialog page 2 cannot be rendered successfully. Ensure the page template in use on page 2 is of template type "Dialog page", with appropriate JavaScript dialog initialization, dialog closure and dialog cancel code defined.

I don't understand the error message since I am using theme 42 and the regular modal dialog handling is working.

Would be grateful for any hints.

Cheers,

~Dietmar.

This post has been answered by Patrick Wolf-Oracle on May 22 2015
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 29 2015
Added on May 21 2015
4 comments
17,505 views