Home » Developer & Programmer » Forms » When-validate-item on a single field block (11g)
When-validate-item on a single field block [message #658261] Wed, 07 December 2016 11:02 Go to next message
mforms
Messages: 3
Registered: December 2016
Junior Member
I have a single single text field and button on a non database block. Initially the button is disabled, but when text is entered into the text field the button to be enabled. How would I be able to achieve that? any help is appreciated.
Re: When-validate-item on a single field block [message #658264 is a reply to message #658261] Wed, 07 December 2016 12:49 Go to previous messageGo to next message
Littlefoot
Messages: 21240
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Try with WHEN-VALIDATE-ITEM on text item, and use SET-ITEM-PROPERTY built-in to modify button's properties. Have a look at Forms Help for more info.
Re: When-validate-item on a single field block [message #658268 is a reply to message #658264] Wed, 07 December 2016 13:58 Go to previous messageGo to next message
mforms
Messages: 3
Registered: December 2016
Junior Member
I did try that, the when-validate-item doesn't seem to fire, because i think since there is only one field, no where to tab out for that trigger to fire?
Re: When-validate-item on a single field block [message #658270 is a reply to message #658268] Wed, 07 December 2016 14:28 Go to previous messageGo to next message
Littlefoot
Messages: 21240
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If the button is keyboard navigable, then there is somewhere to tab out.
Re: When-validate-item on a single field block [message #658280 is a reply to message #658270] Thu, 08 December 2016 03:26 Go to previous messageGo to next message
cookiemonster
Messages: 12929
Registered: September 2008
Location: Rainy Manchester
Senior Member
The button is disabled at the start, so isn't navigable until after WVI fires.
I think in this case you're just going to have to leave the button enabled and have the when-button-pressed check if a value has been entered, if it hasn't raise an error telling the user to enter a value.
Re: When-validate-item on a single field block [message #658311 is a reply to message #658280] Thu, 08 December 2016 13:13 Go to previous messageGo to next message
Littlefoot
Messages: 21240
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
cookiemonster

The button is disabled at the start, so isn't navigable until after WVI fires.

Gosh! Silly me! ./fa/3518/0/ That's what the whole discussion is about! A major deconcentration ...
Re: When-validate-item on a single field block [message #658328 is a reply to message #658311] Fri, 09 December 2016 09:54 Go to previous messageGo to next message
mforms
Messages: 3
Registered: December 2016
Junior Member
Is there any other way to achieve this
Re: When-validate-item on a single field block [message #658356 is a reply to message #658268] Fri, 09 December 2016 13:02 Go to previous messageGo to next message
joy_division
Messages: 4794
Registered: February 2005
Location: East Coast USA
Senior Member
mforms wrote on Wed, 07 December 2016 14:58
I did try that, the when-validate-item doesn't seem to fire, because i think since there is only one field, no where to tab out for that trigger to fire?
But tabbing will just go to the same field and WVI will fire.

What are you actually trying to achieve?

Other than what I said, what cookiemonster said is the best solution.

[Updated on: Fri, 09 December 2016 13:05]

Report message to a moderator

Re: When-validate-item on a single field block [message #658376 is a reply to message #658356] Mon, 12 December 2016 03:49 Go to previous messageGo to next message
cookiemonster
Messages: 12929
Registered: September 2008
Location: Rainy Manchester
Senior Member
Unless the cursor actually moves somewhere else, WVI won't fire. If you've got a single record block with a single enabled item the cursor has no where to go.
Re: When-validate-item on a single field block [message #658392 is a reply to message #658376] Mon, 12 December 2016 08:19 Go to previous messageGo to next message
joy_division
Messages: 4794
Registered: February 2005
Location: East Coast USA
Senior Member
When I press Enter or Tab, the WVI runs for me.
I created a dummy form based on a non-database block, one text item, one button. button is disabled and navigable is set to NO for keyboard and mouse. WVI fires if I hit either key as soon as the form starts, or after I change any value in the text item.
Re: When-validate-item on a single field block [message #658394 is a reply to message #658392] Mon, 12 December 2016 08:41 Go to previous messageGo to next message
cookiemonster
Messages: 12929
Registered: September 2008
Location: Rainy Manchester
Senior Member
I'm surprised but fair enough. Presumably that's not happening for the OP though.
So:
1) What version of forms are you using?
2) What is your form level Defer Required Enforcement property set to?

@mforms - same questions for you.
Re: When-validate-item on a single field block [message #658397 is a reply to message #658394] Mon, 12 December 2016 15:57 Go to previous messageGo to next message
joy_division
Messages: 4794
Registered: February 2005
Location: East Coast USA
Senior Member
Cookie, I tried in both 6i and 11.1.2.2.0.
Defer Required Enforcement is set to No in both.
Re: When-validate-item on a single field block [message #658408 is a reply to message #658397] Tue, 13 December 2016 03:30 Go to previous messageGo to next message
cookiemonster
Messages: 12929
Registered: September 2008
Location: Rainy Manchester
Senior Member
Then the obvious thing to suggest to the OP is that he sets Defer Required Enforcement to No.

Thanks for testing - I don't have a working forms installation to do it myself.
Re: When-validate-item on a single field block [message #658414 is a reply to message #658408] Tue, 13 December 2016 05:49 Go to previous messageGo to next message
Littlefoot
Messages: 21240
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Do you have a non-working forms installation? ./fa/1587/0/
Re: When-validate-item on a single field block [message #658415 is a reply to message #658414] Tue, 13 December 2016 05:58 Go to previous message
cookiemonster
Messages: 12929
Registered: September 2008
Location: Rainy Manchester
Senior Member
Razz
I did, then my PC got nuked by a power cut and I didn't bother trying to reinstall
Previous Topic: to make text-box invisible at run time
Next Topic: To remove a label and text box when user clicks on clear field/screen
Goto Forum:
  


Current Time: Wed Nov 22 12:41:07 CST 2017

Total time taken to generate the page: 0.02287 seconds