Home » Developer & Programmer » Forms » Validation in forms (Forms6i)
Validation in forms [message #321652] Tue, 20 May 2008 23:35 Go to next message
babuanna
Messages: 28
Registered: October 2007
Junior Member
Hi All,

I have a form which has a when-validate-item for one of the items which it is validating.

It has two buttons close and submit.

Say the item is called cur_item has the when-validate-item trigger has fired because it validation failed.

when the user clicks on submit it was still submitting it. in the sense, the data was committed to the database.

So I put the validation in the submit button as well so thatthe submit did not happen. That was fine. So the data was not committing to the database.

The issue now is :
Say I enter a invalid item in the field and the validation fails, and I click on close , the focus returns back to the cur_item where the validation failed.

I would like the close button to close the form without validation. How can I do it?

Thanks in advance...
Re: Validation in forms [message #321654 is a reply to message #321652] Tue, 20 May 2008 23:39 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Put a KEY-EXIT trigger at form level and place EXIT_FORM(NO_VALIDATE) in it.
Re: Validation in forms [message #321690 is a reply to message #321652] Wed, 21 May 2008 01:30 Go to previous messageGo to next message
babuanna
Messages: 28
Registered: October 2007
Junior Member
Hi,

Putting a key-exit trigger at the form level with the
EXIT_FORM(NO_VALIDATE) does not work.

Thanks.
Re: Validation in forms [message #321708 is a reply to message #321690] Wed, 21 May 2008 02:02 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Then do this in addition Exit_Form (No_Validate, Full_RollBack)
Re: Validation in forms [message #321751 is a reply to message #321708] Wed, 21 May 2008 04:21 Go to previous messageGo to next message
Dipali Vithalani
Messages: 278
Registered: March 2007
Location: India
Senior Member

Validate trigger will force the focus not to be moved if the validation fails.
You can put that validation code in key-next trigger of your item. But keep in mind that that will be executed only if you move focus from the item using keyboard. It will not be executed after the navigation through mouse.
Re: Validation in forms [message #321770 is a reply to message #321690] Wed, 21 May 2008 05:11 Go to previous messageGo to next message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
babuanna wrote on Wed, 21 May 2008 08:30
Putting a key-exit trigger at the form level with the
EXIT_FORM(NO_VALIDATE) does not work.

Is there block or item level KEY-EXIT trigger? If so, it will fire before form-level KEY-EXIT trigger.
Re: Validation in forms [message #322620 is a reply to message #321652] Sun, 25 May 2008 04:09 Go to previous messageGo to next message
babuanna
Messages: 28
Registered: October 2007
Junior Member
Hi,

I only a key-exit at the form level.
Although in the when-button-pressed trigger for close, I have the plsql code "key-exit".

The EXIT_FORM(NO_VALIDATE) or the EXIT_FORM(NO_VALIDATE,FULL_ROLLBACK) does not close the form if the validation fails. The focus returns back to the item where the validation has failed.

I cannot put the validation trigger in the key-next-item because I want the validation to fail even if the mouse is clicked.

But I have noticed one strange thing. As I have said in my previous topic,
"cur_item has the when-validate-item trigger has fired because it failed validation.

when the user clicks on submit it was still submitting it. in the sense, the data was committed to the database.

So I put the validation in the submit button as well so thatthe submit did not happen."

How did this submit happen if the focus was to return back to the item where the validation fail. what is that change that made the submit to happen?

Any clues will be highly appreciated.

Thanks in advancce.
Re: Validation in forms [message #322702 is a reply to message #322620] Mon, 26 May 2008 00:13 Go to previous messageGo to next message
azamkhan
Messages: 548
Registered: August 2005
Senior Member
Did you issed "RAISE FORM_TRIGGER_FAILURE"?
Re: Validation in forms [message #322709 is a reply to message #321652] Mon, 26 May 2008 00:44 Go to previous message
babuanna
Messages: 28
Registered: October 2007
Junior Member
Hi,

I think I know why the submit button committed the info in the database even though it failed validation.

But I am just not sure.

The submit button had a mouse navigation property and keyboard Navigate property both set to No. When I set the mouse Navigation property set to Yes, did the same process, the validation failed, and this time when I clicked on submit, it did not submit it through.

Similarly, I put the mouse navigation property on the cancel button set to Yes. Now, I did the same process, the validation failed, and this time when I clicked on cancel, there was a prompt "Close this form" and the form got cancelled.


I am not sure whether the close this form is a default functionality of Cancel in forms or whether my analysis is right as per above?

Anybody can give some suggestions?

Thanks in advance

Previous Topic: set prompt background color
Next Topic: LOV button order
Goto Forum:
  


Current Time: Tue Dec 06 08:17:56 CST 2016

Total time taken to generate the page: 0.14885 seconds