Using Single Alert For Messages And Confirmation Messages In Oracle Forms With Set_Alert_Button_Property
2016-12-24 23:48
1311 查看
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
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
相关文章推荐
- Displaying Modal Window Messages in Oracle Forms Using Show_Alert
- Populate A List Item With Record Group In Oracle Forms Using Populate_List And Create_Group_From_Query Command
- An Example of Pre-Query and Post-Query Triggers in Oracle Forms With Using Display_Item to Highlight Dynamically
- Change Or Set Report Object Property At Run Time In Oracle Forms Using Set_Report_Object_Property Command
- Change An Item Property Using Set_Item_Property In Oracle Forms
- Populate A List Item With Record Group In Oracle Forms Using Populate_List And Create_Group_From_Query Command
- Set Font Properties On Mouse Hover Of Push Button And Text Items At Run time In Oracle Forms
- Styling Alert controls in Flex using the StyleManager class and setStyle() methods
- Using GET_GROUP_SELECTION For Record Groups in Oracle Forms
- Using Find_Alert and Show_Alert in Oracle Forms
- Using UTF-8 as the internal representation for strings in C and C++ with Visual Studio
- Quick Trick About Using Dbms_Metadata With Forms_DDL In Oracle Forms
- Along with all the above benefits, you cannot overlook the space efficiency and performance gains in using DataFrames and Dataset APIs for two reasons.
- Displaying Tabbed and Stacked Canvas Using Show_View In Oracle Forms
- The method setPositiveButton(int, DialogInterface.OnClickListener) in the type AlertDialog.Builder is not applicable for the arguments
- Know How And When To Use System.Message_Level To Control Messages In Oracle Forms
- Database Patch Set Update Overlay Patches Required for Use with PSUs and Oracle E-Business Suite
- The method setButton(int, CharSequence, Message) in the type AlertDialog is not applicable for the a
- Using commands with ApplicationBarMenuItem and ApplicationBarButton in Windows Phone 7
- Creating Vista Gadgets: Using HTML, CSS and JavaScript with Examples in RSS, Ajax, ActiveX (COM) and