Results 1 to 3 of 3

Thread: Field validation

  1. #1
    Ext User pedrosousa's Avatar
    Join Date
    Oct 2008
    Location
    Portugal [Aveiro]
    Posts
    17

    Default Field validation

    Hi everyone,

    I have a question. I was trying to implement a server side validation for form posts. When I validate the data from form I send back the validation errors and set the Fields as invalid (using forceInvalid). Why this method forceInvalid() disables, field validation logic.

    It should clear the invalid on field blur (runnig field validate method).

    Anyone can help?

    Thanks,
    --
    Pedro Sousa

  2. #2
    Ext User pedrosousa's Avatar
    Join Date
    Oct 2008
    Location
    Portugal [Aveiro]
    Posts
    17

    Default

    The class Field.java as the following:

    Code:
    @SuppressWarnings("deprecation")
      protected boolean validateValue(String value) {
        if (forceInvalidText != null) {
          markInvalid(forceInvalidText);
          return false;
        }
        return true;
      }
    Why only validate value if forceInvalidTextis null? I think the best way is: when forcing invalid it should show the field invalid information, and in the first focus should validate again.

    This is very useful when using validation in server side. Receive the errors, forceInvalid the fields, and in the first focus validate again.


    I would like to know someone else, point view.
    --
    Pedro Sousa

  3. #3

    Default

    Quote Originally Posted by pedrosousa View Post
    The class Field.java as the following:

    Code:
    @SuppressWarnings("deprecation")
      protected boolean validateValue(String value) {
        if (forceInvalidText != null) {
          markInvalid(forceInvalidText);
          return false;
        }
        return true;
      }
    Why only validate value if forceInvalidTextis null? I think the best way is: when forcing invalid it should show the field invalid information, and in the first focus should validate again.

    This is very useful when using validation in server side. Receive the errors, forceInvalid the fields, and in the first focus validate again.


    I would like to know someone else, point view.
    Hi all.

    I agree with --pedrosousa in this issue. ExtJs behavior for cases like this is exactly like he
    suggested.

    In my opinion this is a bug.

    Regards

    Paulo Jesus

Posting Permissions

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