Validation in forms [message #321652] |
Tue, 20 May 2008 23:35 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 #321751 is a reply to message #321708] |
Wed, 21 May 2008 04:21 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 #322620 is a reply to message #321652] |
Sun, 25 May 2008 04:09 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
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 #322709 is a reply to message #321652] |
Mon, 26 May 2008 00:44 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
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
|
|
|