Using Single Alert For Messages And Confirmation Messages In Oracle Forms With Set_Alert_Button_Prop...

本文介绍如何在Oracle Forms中使用单个Alert对象来显示警告消息和确认对话框。通过设置Alert属性,可以实现不同类型的提示信息,如警告、确认等。文中提供了具体的代码示例,展示了如何创建带有‘是/否’选项的确认对话框。

Learn how to use single Oracle Form's Alert object for warning/information messages and confirmation messages such as asking for delete confirmation etc. This task can be done using Set_Alert_Button_Property command.

 

Suppose you have created an alert with single button or with two button but for warning messages an alert should have single button and for confirmation messages an alert should have two buttons asking for "Yes/No" or "OK/Cancle", below is the example given to manage single alert for both type messages:

 

Create an Alert in Oracle Forms object navigator and write the following code for giving simple  or warning messages:

 

declare

 n number;

begin

 set_alert_button_property('alert', alert_button2, label, '');

 set_alert_property('alert', alert_message_text, 'Message Alert!');

  n := show_alert('alert');

end;

 

In the above example we are setting alert_button2 (second alert button) property to null means it will not show the second button in alert window.

 

Following is the example to use same alert for asking for confirmation by setting second alert button property to some value:

 

declare

 n number;

begin

 set_alert_button_property('alert', alert_button1, label, 'Yes');

 set_alert_button_property('alert', alert_button2, label, 'No');

 set_alert_property('alert', alert_message_text, 'Do you know Oracle?');

  n := show_alert('alert');

  if n = alert_button1 then

     :buttonsel := 'You choose YES!';

  else

           :buttonsel := 'You choose NO!';

  end if;

end;

 

You can download this demo form from the following link dynalert.fmb

 

Screen shot of this form is below

 

See also: http://www.foxinfotech.in/2013/03/findalert-showalert-oracle-forms.html

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值