Using Find_Alert and Show_Alert in Oracle Forms

Oracle Forms中使用Alert
本文介绍了如何在Oracle Forms中使用Show_alert和Find_alert过程来显示警告消息和确认对话框。通过示例代码展示了如何查找已定义的警告并显示它们,以及如何根据用户的响应采取进一步行动。

Show_alert is used to display model window messages in Oracle Forms and Find_alert searches the list of valid alerts in Form Builder, when the given alert is located, the subprogram returns an alert ID. You must return the ID to an appropriately typed variable, define the variable with a type of Alert.


Example

Show a user-warning alert. If the user presses the OK button, then make REALLY sure they want to continue with another alert.


See also:
Display Modal Window Messages Using Alerts
 
http://www.foxinfotech.in/2015/02/using-single-alert-for-messages-and-confirmation-messages.html


Declare

   al_id       alert;

   al_button   NUMBER;

BEGIN

   al_id := FIND_ALERT ('user_warning');

 

   IF ID_NULL (al_id)

   THEN

      MESSAGE ('user_warning alert does NOT exist');

      RAISE form_trigger_failure;

   ELSE

      /*

      ** Show the warning alert

      */

      al_button := SHOW_ALERT (al_id);

 

      /*

      If user pressed OK (button 1) then bring up another alert to confirm -- button mappings are specified in the alert design

      */

      IF al_button = alert_button1

      THEN

         al_id := FIND_ALERT ('are_you_sure');

 

         IF ID_NULL (al_id)

         THEN

            MESSAGE ('the alert NAMED:are you sure ? does NOT exist');

            RAISE form_trigger_failure;

         ELSE

            al_button := SHOW_ALERT (al_id);

 

            IF al_button = alert_button2

            THEN

               -- do some task

               erase_all_employee_records;

            END IF;

         END IF;

      END IF;

   END IF;

END;

 

Follow to get notifications for tutorials with free source code, thanks.

 


Show_Alert and Find_Alert in Oracle Forms

Reviewed by Mridula Joshi on

Mar 22

Rating:
5

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值