ragunathjawahar / android-saripaar

UI form validation library for Android
Apache License 2.0
3.22k stars 460 forks source link

Do setError automatically (or configurable) #153

Closed stevenay closed 8 years ago

stevenay commented 8 years ago

I know the developers use different ways to show the error message to the user. But currently most of the developers use setError()method as default.

So it will be good if the library show the error messages with setError() automatically on default when the Validation failed. Imagine we can also turn off this feature by passing specific argument to validate() method like async feature.

I understand we can do this setError() in onValidationFailed() callback method by ourselves. But it make feel a little redundant when we have to control multiple forms.

ragunathjawahar commented 8 years ago

Elevating this to the framework level wouldn't be good. A form may have different controls besides EditText and different developers have different approaches. There is no "silver" bullet to solve this problem. The best way to do this would be to have a utility method in the project so that error display can be handled in a unified way across the entire application.