Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View and Model out of sync when model.validate fails #178

Open
amakhrov opened this issue Dec 23, 2013 · 5 comments
Open

View and Model out of sync when model.validate fails #178

amakhrov opened this issue Dec 23, 2013 · 5 comments

Comments

@amakhrov
Copy link
Contributor

Hi

My model attribute has some restrictions defined in Model.validate.
I linked this attribute to the <input> element in the View.
I tried using a binding with modelSetOptions: {validate: true}. It works well in terms of not changing the model when validation fails.
However, the bound input element still keeps the invalid value (that didn't pass the validation).

Is there a way to handle this situation and keep the model and the input element in sync?

Thanks
Alexey

@ghost
Copy link

ghost commented Jan 2, 2014

👍 I have the same problemo

@platinumazure
Copy link
Contributor

@amakhrov @ofir-weinstock-sociomantic Just wondering, does this still happen?

@amakhrov
Copy link
Contributor Author

amakhrov commented Feb 8, 2015

@platinumazure I haven't tried it since then, however I don't see any related changes in ModelBinder that would solve that.

@platinumazure
Copy link
Contributor

@amakhrov Thanks for taking a look. I've created pull request #201 which should fix it; feel free to take a look and weigh in on what you might think of it. Thanks!

@ghost
Copy link

ghost commented Feb 9, 2015

Thanks @platinumazure - It's been a long tim so i can't clearly remember. Me and my colleagues tried a similar solution i think, but eventually gave up and moved to Backbone StickIt as it anyhow more customisable for our needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants