oracle - 在 Apex 5.0 中关闭模式对话框页面之前的确认
问题描述
当使用 (X) 按钮关闭模式对话框页面时,我正在尝试创建一个简单的确认(“您要关闭此窗口吗?”)。
在 Apex 5.0 中实现这一点的最有效方法是什么?
我尝试使用对话框关闭事件来实现解决方案,但这似乎对使用 (X) 按钮关闭对话框没有任何影响。
解决方案
尝试在页面加载时使用该代码在模式页面中创建动态操作:
你的 da 应该执行一个 javascript 代码:
var button = parent.$('.ui-dialog-titlebar-close'); //get the button
button.unbind(); //remove the behavior
//put another behavior to the button
button.on('click', function() {
apex.message.confirm( "Your message here", function( okPressed ) {
if( okPressed ) {
apex.navigation.dialog.cancel(true);
}
});
});
尝试确认“X”按钮是否具有 css 类“ui-dialog-titlebar-close”,它们可以在 apex 版本之间更改。如有必要,使用正确的类更新代码的第一行。
推荐阅读
- filter - 为什么过滤字符串列表会导致错误
- .net - 自 2019 年 4 月 MS-Security 更新以来,Powershell .net 代码变慢
- jpa - 连接列的 JPA 实体映射
- react-native - 如何使用记事本++在本机反应上加载图像
- loops - 如何在不断变化的情况下连续找到最大值
- python - 在全局命名空间中查找类定义中未绑定的局部变量——这是什么意思?
- laravel - 无法在 Google App Engine 中使用 Laravel 找到包装器“gs”
- laravel - Laravel Auth 因重复用户的电子邮件而失败
- linux - 显示当前目录的磁盘空间使用情况,不包括子目录的大小
- excel - 为 Excel VBA 中的单元格赋值会导致 VBA 崩溃且没有消息