Puoi scaricare questo modulo dal seguente link: Modal_Msgt.fmbPer questo esempio ho creato tre avvisi con il seguente nomi:1. Buon_Msg2. Error_Msg3. Ask_AlertIl codice seguente è scritto per il pulsante "Mostra messaggio valido" per visualizzare un messaggio normale, puoi utilizzare questo codice in qualsiasi blocco PLSQL: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;
Il codice seguente è scritto per il pulsante "Mostra messaggio di errore" per visualizzare un messaggio di errore: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; Il codice seguente è scritto per il pulsante "Chiedi conferma" per chiedere una conferma: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;
Iscriviti per ricevere notifiche e-mail per gli ultimi aggiornamenti come questo:
Inserisci il tuo indirizzo e-mail: