Displaying Modal Window Messages in Oracle Forms Using Show_Alert

來源:互聯網
上載者:User

標籤:appear   http   out   value   cap   mail   trigger   nowrap   add   

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:

See also http://www.foxinfotech.in/2015/02/using-single-alert-for-messages-and-confirmation-messages.html

Displaying Modal Window Messages in Oracle Forms Using Show_Alert

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.