I'm having another philosophical breakdown over data binding.

Suppose you one-way bind to a paper-input's value. You register a listener
so you know when the user changes the value:

<paper-input value="[[value]]" on-change="onChange">

The onChange function calls server-side validation, which responds with
min(value, 20), and sets this.value to that response. If the <paper-input>
is set to 21, this.value will be set to 20, which will propagate to the
<paper-input>, keeping it at 20.

But if the <paper-input> is set to 21 again, this.value is already 20. So
onChange is a no-op, and the <paper-input> doesn't change -- it's still 21.
Even calling this.notifyPath doesn't help because of dirty checking.

Example: http://jsfiddle.net/pqa7dywt/2/

I would use two-way data binding, but because onChange actually has to
happen asynchronously (e.g. AJAX), it would cause an infinite loop when the
value changes twice in between responses.

Is there some Polymery way to force-update bindings?

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/CACi5S_30WaT%2BR8knJAbqv7K2ey3DhxtMA_BVewAdOF2%2B9V0mvw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to