PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Validator Ignored?  (Read 635 times)

James Zukowski

  • Diamond Member
  • *****
  • Posts: 297
    • View Profile
Validator Ignored?
« on: October 07, 2022, 11:46:42 AM »
I've got a multi-line field with both validation and formatting routines attached. If a value is entered into the field and the user mouse-clicks into a different field, it seems like the Validator is skipped, but the Formatter is not.
Is this correct behavior? I thought the Validator would check on any exit from the field.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

Mike King

  • Diamond Member
  • *****
  • Posts: 3811
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Validator Ignored?
« Reply #1 on: October 07, 2022, 12:18:38 PM »
The validator should be being invoked whenever the contents of the field changes or when you exit the field if the field is set to Signal on Exit.

If the user simply enters the field and then exits the field without making any changes the validator will not be called (unless signal on Exit is set).

Also if the user enters the field, makes changes but then clicks on a button marked as Signal only the validator will not be called since technically clicking on a Signal Only button does not change focus out of the field.  Signal Only buttons are common when declaring things such as a Cancel button where you don't want to necessarily validate a field when a user is trying to exit a panel.
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

James Zukowski

  • Diamond Member
  • *****
  • Posts: 297
    • View Profile
Re: Validator Ignored?
« Reply #2 on: October 07, 2022, 02:05:34 PM »
Mike:
I haven't used the Validator/Formatter options too much, relying mostly on On Change logic to do the work. In those routines, I typically include a pos(_eom$=$...$) test. Going through this process, I discovered that this is not needed. But I also have to allow for null values in the field, if appropriate.
Thanks for the help.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services