Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8949233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:10:55+00:00 2026-06-15T13:10:55+00:00

I have set a Validator on a TextField using setValidator(). The input is validated

  • 0

I have set a Validator on a TextField using setValidator(). The input is validated fine when I run the application.

When writing unit tests against my GUI I set the validator on the TextField and then set the value to a invalid value. However when I call isValid() or validate() on the TextField it always returns true.

When calling the validator.validate on the TextField with its value, it returns false.

Am I misunderstanding the isValid() and validate() method on the TextField? Or do I need to fire some Event before the validation kicks in, in my test?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:10:55+00:00Added an answer on June 15, 2026 at 1:10 pm

    Inspected the source code and from what I see the validate() and isValid() methods all check the value using getRawValue() which is the value rendered in the HTML element, and an attempt to directly set the raw value will still fail since it checks for a rendered flag which requires a call to render().

    public String getRawValue() {
        String v = rendered ? getInputEl().getValue() : "";
        if (v == null || v.equals(emptyText)) {
          return "";
        }
        return v;
    }
    

    A solution would be to subclass the TextField and overwrite these methods, but I rather stick to calling the validator.validate() then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have one textfield for input some serial number code.i want set this code
I have started using Zend_Validate_EmailAddress with the mx and deep options set to true.
I have set up upload_max_filesize and post_max_size to 32Mb in php.ini. I am using
I have a form which has a input text and a set of radio
I am developing a mobile site which has multiple divs. I have validator set
I’m using jQuery Validate for my site’s contact form. The input fields have pre-populated
I'm using omniauth-twitter and I have everything set up: user.rb: def self.create_with_omniauth(auth) create! do
I have a question concerning the TextField of Vaadin. I want to block input
I have set validation attributes in the model of my WCF service [MinLength(6, ErrorMessage
I have a range named STATE. I want to set data validation in range

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.