0

MVVM, How to display @validator error like the constraint attribut error ?

asked 2015-06-19 17:38:10 +0800

WilliamB gravatar image WilliamB
1609 1 6

I'm using mvvm and @validator to do server side validation. I've seen on exemple people using label to display the error messages.

However I was wondering how could I display the validation error exactly like the constraint attribut displays its error : Small red popin on the side of the field.

Thank you

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-06-23 10:00:34 +0800

hawk gravatar image hawk
2255 1 5
http://hawkphoenix.blogsp... ZK Team
  • pass the input component to a validator, like <textbox value="@validator(vm.myValidator, component=self)"/>
  • get the passed component from context
  • call inputComponent.setErrorMessage() inside the validator
link publish delete flag offensive edit

Comments

Thank you. I went a different way because i wanted to use form validation instead but this would have worked ;)

WilliamB ( 2015-06-23 11:33:40 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-06-19 17:38:10 +0800

Seen: 26 times

Last updated: Jun 23 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More