Displaying Modal Window Messages in Oracle Forms Using Show_Alert

You can display modal windows in Oracle Forms to display normal messages, error message 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 Alert option in Oracle forms.

This is the screen shot below for this example:

You can download this form from the following link: Modal_Msgt.fmb

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 FeedBurner
See also http://www.foxinfotech.in/2015/02/using-single-alert-for-messages-and-confirmation-messages.html

时间: 2024-10-29 19:07:44

Displaying Modal Window Messages in Oracle Forms Using Show_Alert的相关文章

Using Single Alert For Messages And Confirmation Messages In Oracle Forms With Set_Alert_Button_Property

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

Using Find_Alert and Show_Alert in Oracle Forms

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 type

Displaying Window In Center In Oracle Forms 6i

Center window automatically  in Oracle Forms 6i, use the following procedure by passing window name as parameter: Example PROCEDURE auto_centre (pwn in varchar2) ISvw number := get_window_property(forms_mdi_window, width);vh number := get_window_prop

Create Custom Modal Dialog Windows For User Input In Oracle Forms

An example is given below to how to create a modal dialog window in Oracle Forms for asking user input and return the value to any text item. The following is the screen shot of this demo and this form could be downloaded from the following link: Cus

An Example of On-Error Trigger in Oracle Forms

I wrote this trigger around 4 years ago to handle errors in an application based on Oracle Forms 6i. This trigger handles all errors with some custom messages for some specific errors and not only this after giving an appropriate message to the user

8 Most Required Examples Reference For Oracle Forms

Check the following 8 Links for best Oracle Forms examples with source code (Fmb files), which will work in any version of Oracle Forms. The examples are given for "Oracle Form's Triggers", "Hierarchical Trees", "Stacked Canvases&

Learn How To Create Trigger In Oracle Forms

I have written many posts related to triggers in Oracle Forms, I have given examples for Form Level triggers, Data Block Level triggers and Item Level Triggers. And in this tutorial I am just giving the simple tutorial to how to create a trigger in O

在Window下安装Oracle

在Window下安装Oracle数据库详解 一.Oracle解压包下载地址 http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html 二.解压Oracle解压包文件 1.解压如下两份文件,解压到当前同一个文件夹 2.解压完成后会多出如下database文件夹 3.进入database文件夹,会见到如下文件 会弹出如下窗口,等待安装操作中 三.如下是安装步骤 1.电子邮箱可以不填,去掉选项勾

Writing On-Error Trigger In Oracle Forms

Suppose you want to handle an error in oracle forms and want to display custom error message for that error, but also you want to customize more for a particular error. For example there are many fields in form with required property is set to TRUE f