Results 1 to 3 of 3

Thread: Bug in TextField.validateValue ???

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    2
    Vote Rating
    0
      0  

    Question Bug in TextField.validateValue ???

    Applies to Ext GWT up to 2.2.5

    In case of an empty string and blanks allowed, TextField.validateValue will invoke Field.clearValidate. However, this means, that even if called via Field.isValid, validation errors will be cleared. IMHO that's a nasty side effect of a method which returns a boolean result (and causing me some headache). I am absolutely fine with Field.validate doing this, but then that one is implying completly different semantics ("do something" instead of "check something").

    So before going and hacking the code (it really causes problems at this end), I'd just like to know whether there actually might be a reason for this ... and possibly a bugfix (I checked 2.2.5 though and nope).

    Thanks a lot (and tanks anyway for this fantastic library)!

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,737
    Vote Rating
    93
      0  

    Default

    Unless I am misunderstanding, this is only a bug if you expect there to be validation error messages for an otherwise valid value. If you want to set an error message such that it cannot be cleared by validating the field, use the forceInvalid(String) method.

    Yes, the semantics are a little off, but the behavior is there to make sure the value returned is consistent with the ui.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    2
    Vote Rating
    0
      0  

    Default ok

    Thanks for the answer. It's fair enough. Problem is, that some code I inherited sets error messages based on complex server side validation logic -- and I cannot use forceInvalid for other complex reasons (yea ... I know ... but hacking the GXT code was the simplest solution right now).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •