Home » Developer & Programmer » Forms » how to suppress validation?
how to suppress validation? [message #83241] Tue, 26 August 2003 05:16 Go to next message
Anvar Hussain K.M.
Messages: 6
Registered: January 2002
Junior Member
Hi,

I have a data entry form with text items and some buttons. I have written code to validate text entered by users in 'when validate item' trigger. I have also three buttons 'update', 'cancel' and 'exit'.

The problem is with cancel. It is intended to clear the present data of the form and start new entry by the user. The 'clear_form(no_validate)' is the code for this button.

If the user, in the middle of entry and there are items with invalid data, wishes to start a fresh entry (by clicking cancel button), always the when_validate_trigger for the item triggers and clear_form does not work unitl valid data is entered in the items. Is there any way to overcome this problem?

Thanks,
Anvar
Re: how to suppress validation? [message #83242 is a reply to message #83241] Tue, 26 August 2003 19:52 Go to previous messageGo to next message
Shailender Mehta
Messages: 49
Registered: June 2003
Member
Hi,

What you can try is the following :-

1. Create a non-database control block display field
(Data type = Number, Size =1)
2. In the When-Buton pressed of the following
buttons, set the value to :

When Clear button is pressed : Set the value to 1
All other buttons : Set the value to 0.

When New form instance : Initialize to 0

3. In When-Validate triggers, add in a extra line,

If ( Nvl(:control_block.NEWFIELD,0) = 0 ) Then
< Your Code goes here >
End If;

What i'm suggesting here is :-

- When-Validate will ONLY fire when the value of
the field NEWFIELD is 0. Since it is
set to '1' when CLEAR button is pressed, the
trigger code should not execute.

You can give it a try.
Re: how to suppress validation? [message #83248 is a reply to message #83242] Wed, 27 August 2003 05:26 Go to previous messageGo to next message
Anvar Hussain K.M.
Messages: 6
Registered: January 2002
Junior Member
Hi Mr.Shailender Mehta,

Thanks for the the mail.

But I'm afraid it will not solve my problem. Initially NEWFIELd = 0 (ie . when_validate fires). So the validation trigger will fire even before when_button_pressed fires, when NEWFIELD is still 0. I think I might be able to overcome the problem by writing code in the mouse_enter_item and mouse_leave_items and forcing validation at key_next_item.

Since this is a common scenario, I feel some simpler logic would be available.
Anvar.
Re: how to suppress validation? [message #83253 is a reply to message #83241] Fri, 29 August 2003 04:11 Go to previous messageGo to next message
sathya
Messages: 27
Registered: December 2000
Junior Member
hi,
hope u have kept the buttons in control block.(not compulsory)
all u have to do is , just do the following settings
in property palette of "cancel" button.

keyboard Navigable : NO
mouse Navigable : NO.

I feel now it works.

Reason : If both of the above properties set YES , then when u press the button, control moves out of the text field (for which u said validation failed).when control moves out the text field , validation has to fire.
if u make these 2 properties of button false , then eventhough u r pressing the button, control will be in text field only, so validation will not fire. rather button pressed trigger will fire (clear_form(no_validate)).

give a try.

satya.
Re: how to suppress validation? [message #83262 is a reply to message #83253] Sat, 30 August 2003 02:07 Go to previous messageGo to next message
Anvar Hussain K.M.
Messages: 6
Registered: January 2002
Junior Member
Hi Sathya,

Yes, it has worked perfectly. Is it not qeer that you can click the mouse inside an item which cannot be entered?
Thank you.

Anvar.
Re: how to suppress validation? [message #83288 is a reply to message #83241] Thu, 04 September 2003 13:58 Go to previous messageGo to next message
jeet
Messages: 1
Registered: September 2003
Junior Member
try using if condition to check data,
which u might have used in cancel button click
event and use clear_record

this will resolve ur prob.

in case of any doubts get back!!
Re: how to suppress validation? [message #83735 is a reply to message #83253] Thu, 04 December 2003 04:02 Go to previous message
Susmita Sarkar
Messages: 3
Registered: December 2003
Junior Member
Hi,
I am facing a peculiar problem and not able to solve it for last 4 days.
I have kept the buttons in control block
and done the following settings
in property palette of "cancel" button.
keyboard Navigable : NO
mouse Navigable : NO.

Still the when-validate-item and when-validate triggers are getting fired when I am pressing CANCAL button from a record in multi-record block.
The following is the situation:
I added a new record at the end of the displayed record and changed the item of a list item(4th field of the record), then pressed 'Cancel' button. All The validations are fired starting from the 1st field in the record.
Please let me know, when your above said solution can fail.

I am to deliver the code to the client this week.
Previous Topic: Cursor width in Forms
Next Topic: Calling word document
Goto Forum:
  


Current Time: Sat Aug 13 00:36:03 CDT 2022