Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    31
    Vote Rating
    0
    kozla13 is on a distinguished road

      0  

    Default Problem with markInvalid

    Problem with markInvalid


    i have TextField email, and i am doing some custom validation, where i put
    email.markInvalid(LANGUAGES.userExist());

    and the error message is dispayd on the fild .

    error.png

    then after calling driver.hasErrors() returns FALSE
    Is this a bug ?

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Vote Rating
    90
    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


    Are you calling flush() first? The individual fields do not register errors until flush() to prevent from registering an error which may later be cleaned up.

    If so, can you make up a bug report using the bug template?

  3. #3
    Sencha User
    Join Date
    Apr 2013
    Posts
    31
    Vote Rating
    0
    kozla13 is on a distinguished road

      0  

    Default


    Quote Originally Posted by Colin Alworth View Post
    Are you calling flush() first? The individual fields do not register errors until flush() to prevent from registering an error which may later be cleaned up.

    If so, can you make up a bug report using the bug template?
    i am calling flusch before testing


    req = driver.flush();
    if (driver.hasErrors()) {
    Info.display("Title", LANGUAGES.warning());
    return;
    }

  4. #4
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,734
    Vote Rating
    90
    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


    Isn't this what is supposed to happen? When you flush(), it runs validation again to make sure that all fields are valid as they should be, which may clear the markInvalid message. From the javadocs:
    Code:
      /**
       * Marks this field as invalid. Validation will still run if called again, and the error message will be changed or
       * cleared based on validation. To set a error message that will not be cleared until manually cleared see
       * {@link #forceInvalid(String)}
       * 
       * @param msg the validation message
       */
      public void markInvalid(String msg) {
    Do you perhaps mean to be calling forceInvalid instead, or adding a Validator to the field?

Thread Participants: 1

Tags for this Thread