Hi,

I can't think of a direct way to do this except for merging the data on
load, and splitting it when you save it. However, you can achieve the
connection you want using a computed binding to set the value of the
checkbox, and an event listener to handle the set case. There's an example
here:

https://jsbin.com/pusazuc/4/edit?html,output

Note that the getValue method is fairly generic, since you path in the path
to the object. It's a little harder to make the listener generic. But you
could stick a piece of data on the DOM node for the event handler to pick
up. (Here's a version that does that, stowing the path as the `my-path`
attribute on the checkbox, so you could use the same generic function in
different places. Whether or not this approach is useful to you would
depend a lot on the structure of your app & data.

https://jsbin.com/pusazuc/6/edit?html,console,output

Hope that helps.
Arthur


On Wed, Jun 15, 2016 at 7:11 AM, <[email protected]> wrote:

> Hello, I'm working on a web based administration application that needs
> some bindings that don't seem to be supported.  I've posted a live demo of
> the simplest test case at [1].  The goal is to be able to use two-way
> binding on the properties of obj.  In real life both properties arr and obj
> would be populated by iron-ajax.  This pattern would be fairly common in my
> app.  A real world example for using this pattern is to have a global array
> of groups into arr, and the membership of a single user in obj.  Merging
> the data from obj into arr would not be a good solution - it would be very
> wasteful to transmit 'arr' in every AJAX GET/POST.
>
> I'm unsure if I really want a way to create two-level binding as proposed
> in the jsbin, or if I need a way to create a lookup property (with a getter
> and setter in code).
>
> [1] https://jsbin.com/zofazonuwa/edit?html,output
>
> 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/a55c420d-2685-4cee-8585-6877faff2be2%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/a55c420d-2685-4cee-8585-6877faff2be2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

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/CADSbU_ydbJ3z5_4uGooQmkCQ_oF_biRDvNCky%2BApWgcH0eLJBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to