Hybrid View

    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
    mburkhart is on a distinguished road

      0  

    Question Bug in TextField.validateValue ???

    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,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      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
    mburkhart is on a distinguished road

      0  

    Default ok

    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).

Thread Participants: 1