通过JavaScript Oracle APEX打开模式对话框 [英] Open modal dialog through JavaScript Oracle APEX
本文介绍了通过JavaScript Oracle APEX打开模式对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试通过JavaScript重定向URL打开模式对话框页面.
I am trying to open a modal dialog page through a JavaScript redirect URL.
我的代码是这样的:
$('#Subnet tr').each(function (i, row){
var $row = $(row);
var $hostname = $row.find('[headers=Hostname]');
if($hostname.text() == '-'){
var url = "f?p="+$v('pFlowId')+":113:"+$v('pInstance')+"::::P113_SUBNET_ID:"+$row.find('[headers=ID]').text();
$hostname.html("<a href='"+url+"'><span class='fa fa-plus-square-o'></span></a>");
console.log($row.find('[headers=ID]').text()+ ' / '+$row.find('[headers=Address]').text());
}
});
但是我收到一条错误消息:
but I get an error that says:
谁能告诉我我做错了什么?
Can anyone tell me what I did wrong?
或者是重定向到模式对话框页面的另一种方法?
Or maybe another way to redirect to a modal dialog page?
推荐答案
您应该使用页面处理来计算URL. 这可能是一个Ajax流程:
You should use a Page Process to calculate an URL. This could be an Ajax Process:
DECLARE
l_url varchar2(2000);
l_app number := v('APP_ID');
l_session number := v('APP_SESSION');
l_item_name VARCHAR2(2000) := 'P27_XYZ';
BEGIN
l_url := APEX_UTIL.PREPARE_URL(
p_url => 'f?p=' || l_app || ':'||apex_application.g_x01||':'||l_session||'::NO::'||l_item_name||':'||apex_application.g_x02,
p_checksum_type => 'SESSION');
htp.p(l_url);
END;
使用此Javascript进行调用:
Call that with this Javascript:
apex.server.process(
'PREPARE_URL',
{
x01: 27,
x02: 'myvalue'
},
{
success: function (pData)
{
console.log(pData);
},
dataType: "text"
}
);
您将获得一个javascript代码,您需要调用它.它会计算出正确的校验和,您可以完美地打开对话框.
You will get a javascript code back, and you need to call that. It'll calculate the correct Checksum and you can open the Dialog perfectly.
这篇关于通过JavaScript Oracle APEX打开模式对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文