博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Displaying Modal Window Messages in Oracle Forms Using Show_Alert
阅读量:6297 次
发布时间:2019-06-22

本文共 2322 字,大约阅读时间需要 7 分钟。

You can display modal windows in Oracle Forms to display normal messages, 
 or asking for confirmation eg. on deleting a record or saving a record etc. using show_alert command.
 
These modal window messages can be shown using 
.
 
This is the screen shot below for this example:
 
 
You can download this form from the following link:
For this example I have created three alerts with the following names:
 
1. Good_Msg
2. Error_Msg
3. Ask_Alert
 
The following code is written for "Show Good Message" button to display a normal message, you can use this code in any PLSQL block:
 
Declare
-- create a numeric variable to hold show_alert return value
nalertbutton number;
Begin
-- set the message for alert
set_alert_property('good_msg', alert_message_text, 'Records saved successfully.');
-- after below statement the execution will hold till you click on ok.. becuase it is an modal window
nalertbutton := show_alert('good_msg');
:alertblock.result := 'That was a good message.';
-- after this you can perform any task...
End;
 
The following code is written for "Show Error Message" button to display an Error message:
 
Declare
-- create a numeric variable to hold show_alert return value
nalertbutton number;
Begin
-- set the message for alert
set_alert_property('error_msg', alert_message_text, 'An error occurred.');
-- after below statement the execution will hold till you click on ok.. becuase it is an modal window
nalertbutton := show_alert('error_msg');
:alertblock.result := 'That was an ERROR message.';
-- after this you can perform any task...
End;
The following code is written for "Ask Confirmation" button to ask for a confirmation:
 
Declare
-- create a numeric variable to hold show_alert return value
nalertbutton number;
Begin
-- set the message for alert
set_alert_property('ask_alert', alert_message_text, 'Confirm Yes or No?');
-- after below statement the execution will hold till you click on ok.. becuase it is an modal window
nalertbutton := show_alert('ask_alert');
-- now check which button or answer have been choosen
if nalertbutton = alert_button1 then
:alertblock.result := 'You choose Yes.';
else
:alertblock.result := 'You choose No.';
end if;
-- after this you can perform any task...
End;
Subscribe To Get Email Notifications For Latest Updates Like This:
Enter your email address:
Delivered by 
See also

转载地址:http://nilta.baihongyu.com/

你可能感兴趣的文章
PHP导出table为xls出现乱码解决方法
查看>>
PHP问题 —— 丢失SESSION
查看>>
Java中Object类的equals()和hashCode()方法深入解析
查看>>
数据库
查看>>
dojo.mixin(混合进)、dojo.extend、dojo.declare
查看>>
Python 数据类型
查看>>
iOS--环信集成并修改头像和昵称(需要自己的服务器)
查看>>
PHP版微信权限验证配置,音频文件下载,FFmpeg转码,上传OSS和删除转存服务器本地文件...
查看>>
教程前言 - 回归宣言
查看>>
PHP 7.1是否支持操作符重载?
查看>>
Vue.js 中v-for和v-if一起使用,来判断select中的option为选中项
查看>>
Java中AES加密解密以及签名校验
查看>>
定义内部类 继承 AsyncTask 来实现异步网络请求
查看>>
VC中怎么读取.txt文件
查看>>
如何清理mac系统垃圾
查看>>
企业中最佳虚拟机软件应用程序—Parallels Deskto
查看>>
Nginx配置文件详细说明
查看>>
怎么用Navicat Premium图标编辑器创建表
查看>>
Spring配置文件(2)配置方式
查看>>
MariaDB/Mysql 批量插入 批量更新
查看>>