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.