Tree Oracle APEX |对话框页面关闭后如何刷新树
我想在关闭调用对话框页面后刷新调用方页面(或提交页面)中的树区域 树区域不支持本机顶点刷新事件。你可以阅读这个问题的一些解释 但是 你们可以用一种很糟糕的方式来做,所谓糟糕,我的意思是通过AJAX调用用树区域重新加载当前页面 所以,我假设你有两页Tree Oracle APEX |对话框页面关闭后如何刷新树,tree,oracle-apex-5,Tree,Oracle Apex 5,我想在关闭调用对话框页面后刷新调用方页面(或提交页面)中的树区域 树区域不支持本机顶点刷新事件。你可以阅读这个问题的一些解释 但是 你们可以用一种很糟糕的方式来做,所谓糟糕,我的意思是通过AJAX调用用树区域重新加载当前页面 所以,我假设你有两页 带有树区域的主页(第10页) 模式页面(第11页) 在你的主页上 具有静态id的树区域test 按钮OPENPOPUP打开弹出窗口 绑定到事件的动态操作对话框已关闭(选择类型按钮,按钮打开弹出) true action执行JavaScript代
- 带有树区域的主页(第10页)
- 模式页面(第11页)
- 具有静态id的树区域
test
- 按钮
打开弹出窗口OPENPOPUP
- 绑定到事件的动态操作
(选择类型对话框已关闭
,按钮按钮
)打开弹出
- true action
-应该刷新树区域的代码执行JavaScript代码
- true action
- 按钮
具有定义的动态动作,可触发真正的动作CLOSEPOPUP
关闭对话框
执行JavaScript代码
,该代码将在每次使用按钮关闭弹出窗口时加载树区域的最新版本
我很担心是否有可能绕过缺乏刷新支持的问题。所以我编写了自己的executejavascript代码
,只从主页加载树区域
var
treeRegionStaticId = '#test',
currentTree = $(treeRegionStaticId);
parent = currentTree.parent();
$.ajax({
url: apex.server.url ({}, $v('pFlowStepId')),
dataType: 'html',
method : 'GET',
success: function( data ){
var
temp = $('<html />'),
newTree,
id;
temp.html( data );
//find region with id 'test'
newTree = temp.find( treeRegionStaticId );
//get id that is needed to call APEX tree constructor
id = newTree.find('[aria-label="Tree"]').attr('id');
//remove old tree region
currentTree.remove();
//append new tree region
newTree.appendTo( parent );
//call apex tree constructor
eval( 'apex.widget.tree.init( \''+id+'\', {}, gT'+(id.substr(1, id.length))+'Data,"S","",true,false,false,"a-Icon")' )
}
})
var
treeRegionStaticId=“#测试”,
currentTree=$(treeRegionStaticId);
parent=currentTree.parent();
$.ajax({
url:apex.server.url({},$v('pFlowStepId'),
数据类型:“html”,
方法:“GET”,
成功:功能(数据){
变量
温度=$(''),
纽特里,
身份证件
临时html(数据);
//查找id为“test”的区域
newTree=临时查找(treeRegionStaticId);
//获取调用APEX树构造函数所需的id
id=newTree.find('[aria label=“Tree”]').attr('id');
//移除老树区域
currentTree.remove();
//追加新树区域
newTree.appendTo(父级);
//调用顶点树构造函数
eval('apex.widget.tree.init(\''+id+'\',{},gT'+(id.substr(1,id.length))+'Data,“S”,“”,true,false,false,“a-Icon”))
}
})
我已经在本地APEX 5上测试了它,每次我在模式页面中使用CLOSEPOPUP
按钮时,模式页面关闭后树区域都会刷新
在绑定到主页上关闭的事件对话框的动态操作中,上面的代码应该用作执行JavaScript代码
var
treeRegionStaticId = '#test',
currentTree = $(treeRegionStaticId);
parent = currentTree.parent();
$.ajax({
url: apex.server.url ({}, $v('pFlowStepId')),
dataType: 'html',
method : 'GET',
success: function( data ){
var
temp = $('<html />'),
newTree,
id;
temp.html( data );
//find region with id 'test'
newTree = temp.find( treeRegionStaticId );
//get id that is needed to call APEX tree constructor
id = newTree.find('[aria-label="Tree"]').attr('id');
//remove old tree region
currentTree.remove();
//append new tree region
newTree.appendTo( parent );
//call apex tree constructor
eval( 'apex.widget.tree.init( \''+id+'\', {}, gT'+(id.substr(1, id.length))+'Data,"S","",true,false,false,"a-Icon")' )
}
})
顺便说一句,数据库的负担与使用apex相同。提交
以重新加载页面。没有与此操作相关的代码。在对话框页面(第01页)中完成工作并关闭后,我从当前打开的页面(第02页)打开对话框页面(第01页),我希望提交(第02页)。我该怎么做呢。提前谢谢。再一次,请张贴代码。你能不能比“我怎么做?”更具体一点?到目前为止你做了什么?出了什么问题了?我希望(第02页)在我关闭对话框页面(第01页)后自动提交。是的,但仅仅根据你提供的细节很难帮到你,您确实没有为我们提供足够的上下文信息,无法知道如何帮助您。非常感谢您的努力,它删除了树数据,但再也无法构建树。如果您在apex.oracle.com上复制用例,我可以仔细查看。我只需要工作区名称和登录凭据。apex用户名:sadammashaal@hotmail.com传球:马沙尔。项目名称:销售页面:单位层次结构对话框页面:添加/编辑单位。非常感谢。工作区:meshaalIn您的示例主页和模式页面没有通过动态操作正确绑定。关闭模式后不执行DA。我没有修复您的示例,而是导入了用于开发答案的测试应用程序-APP_ID 42153
。去。从第10页开始
,展开一些树叶,单击弹出
按钮,单击关闭
按钮。关闭后,将刷新模式树区域。您可以使用console>network检查它,并查看AJAX的结果。我的例子是有效的。检查我的测试页面并尝试实现它。