Giter Club home page Giter Club logo

Comments (5)

ragunathjawahar avatar ragunathjawahar commented on July 16, 2024

@sytolk this is a problem with Android and not a Saripaar behavior. Since you can get all the EditText references, you could loop through them inside the OnClickListener before calling mValidator.validate().

from android-saripaar.

sytolk avatar sytolk commented on July 16, 2024

I know but its better to use function before validate like:
removeErrors();
mValidator.validate();

void removeErrors(){
Map<String, Object> mProperties = mValidator.getMProperties();
for(Object edit :mProperties.values()){
(EditText ) edit.setError(null);
}
}

the problem is that I don`t have mValidator.getMProperties(); public method

from android-saripaar.

ragunathjawahar avatar ragunathjawahar commented on July 16, 2024

mProperties allows users to put in custom properties that they'd like to use with the validator. It doesn't not contain references to views. Besides,

  1. The problem that you are noticing is platform specific on Android. It doesn't happen on all Android versions. So, it would be better to use the workaround that you've come up with instead of doing that from within the library.
  2. The error messages need not be set using the EditText.setError() method. Developers could be showing error messages using a Toast, the Crouton library or via a plain TextView, therefore the library could not figure out the means that was used to display the error message.

from android-saripaar.

ragunathjawahar avatar ragunathjawahar commented on July 16, 2024

@sytolk, a similar issue was reported last year. Using a TextWatcher as a workaround might help. Please check issue #5

from android-saripaar.

sytolk avatar sytolk commented on July 16, 2024

Thanks but I don`t think that TextWatcher can help me. I use androidannotations @focuschange annotation on validation method.

The problem is that:
I have annotated variables @password @Email ...
I cant get list of all annotated variables from validation framework -> public method mValidator.getMProperties() is missing.. why ?
I need to:

  1. to annotate variables
  2. to hold list of annotated variables -> this list is written in validation framework too (mProperties)
  3. to add some Watcher to setError(null) or something else

can I skip step 2 ?

from android-saripaar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.