Home » Developer & Programmer » Forms » Alert Buttons
Alert Buttons [message #189178] Wed, 23 August 2006 09:01 Go to next message
Prince
Messages: 32
Registered: December 2001
Member
I have a parameter form that passes values to another form - This part works fine. Now, I want to add an alert message to display the information
('Your date is '||:var_1)
which the user inputs and then allow the User to ACCEPT (OK) or RETURN and change the value (CANCEL) before it is parsed to the next form. The OK part I got going but how can I make the CANCEL button return back to the form field if the user made a mistake or changes their mind about the value they put and want to return to the form. Any advise is greatly appreciated. Thanks!
Re: Alert Buttons [message #189314 is a reply to message #189178] Thu, 24 August 2006 02:40 Go to previous messageGo to next message
sameer_am2002
Messages: 129
Registered: September 2002
Senior Member
You call your form in if condition of Ok button...Hope u got the answer..When he presses cancel dont do anything..it simply remain in the current form..
Re: Alert Buttons [message #189412 is a reply to message #189314] Thu, 24 August 2006 09:08 Go to previous messageGo to next message
Prince
Messages: 32
Registered: December 2001
Member
I am not clear on what you tried to explain. Maybe I should expantiate on the scenario: After a user types in a date, they then go ahead to push a run button. On the run button I have a WHEN-BUTTON-PRESSED Trigger with the following code in it:
DECLARE
	v_param_id paramlist;
	al_button number;
BEGIN
 set_alert_property('ALT_MESSAGE',TITLE,'Message');
 set_alert_property('ALT_MESSAGE',ALERT_MESSAGE_TEXT,'You are about to Run Reports for '||TO_CHAR(:ctrl_1.var_date,'MM/DD/RRRR'));	
 al_button := show_alert('ALT_MESSAGE');
v_param_id := create_parameter_list('DT');
add_parameter(v_param_id,'PRM_VAR_DATE',TEXT_PARAMETER,TO_CHAR(:ctrl_1.var_date,'MM/DD/RRRR'));
NEW_FORM('FRM_1023B',TO_SAVEPOINT,NO_QUERY_ONLY, v_param_id);
END;

Previously, I had only an OK button on my default alert (ALT_MESSAGE) which just pops up and the user clicks OKAY to continue. Now, I want to add another button to CANCEL and return back to the form's date_field (incase the date is wrong or the user changes their mind about it). How do I modify this piece of code to do return to the form, if the user chooses to CANCEL the process?
Thanks again.
Re: Alert Buttons [message #189732 is a reply to message #189178] Sat, 26 August 2006 00:35 Go to previous messageGo to next message
sameer_am2002
Messages: 129
Registered: September 2002
Senior Member
DECLARE
v_param_id paramlist;
al_button number;
BEGIN
set_alert_property('ALT_MESSAGE',TITLE,'Message');
set_alert_property('ALT_MESSAGE',ALERT_MESSAGE_TEXT,'You are about to Run Reports for '||TO_CHAR(:ctrl_1.var_date,'MM/DD/RRRR'));
al_button := show_alert('ALT_MESSAGE');
if al_button = alert_button1 then
v_param_id := create_parameter_list('DT');
add_parameter(v_param_id,'PRM_VAR_DATE',TEXT_PARAMETER,TO_CHAR(:ctrl_1.var_date,'MM/DD/RRRR'));
NEW_FORM('FRM_1023B',TO_SAVEPOINT,NO_QUERY_ONLY, v_param_id);
else
whtever you want to do..Maybe you want to send the cursor back to datefield.
end if ;
END;

Hope answer your question well...
Sorry to ask you..Are you new to this field...Just a question...Coz it was very simple logic..
Re: Alert Buttons [message #189757 is a reply to message #189732] Sat, 26 August 2006 09:22 Go to previous message
Prince
Messages: 32
Registered: December 2001
Member
Yes I am new to forms. Did not know about the ALERT_BUTTON1, ALERT_BUTTON2 and ALERT_BUTTON3 that I could use to check the return values from the alert. I finally got it working yesterday though. Thanks for all your help! I greatly appreciate it.
Previous Topic: Icons not displayed on forms Oracle 9i when running
Next Topic: TEXT_IO Package usage
Goto Forum:
  


Current Time: Sat Dec 10 22:11:32 CST 2016

Total time taken to generate the page: 0.06711 seconds