Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Multiselect values do not trigger updates #245

Closed
parente opened this issue Mar 1, 2016 · 6 comments
Closed

Multiselect values do not trigger updates #245

parente opened this issue Mar 1, 2016 · 6 comments

Comments

@parente
Copy link
Member

parente commented Mar 1, 2016

Grab example from https://gist.github.com/parente/d167f45547dce313529b and follow the instructions within it.

Tested against decl widgets 0.4.1.

@parente
Copy link
Member Author

parente commented Mar 1, 2016

ping @lbustelo

@lbustelo
Copy link
Collaborator

lbustelo commented Mar 2, 2016

@deedubbu found this bug PolymerElements/iron-selector#103. The fact that the h1 content is not changing points to an issue in Polymer. The same issue seems to be happening to urth-core-function, although when I inspect the object in the JS console, the correct values are getting set internally, but no property lister is getting fired. Again, that seems to be a defect in Polymer.

I've condensed the gist at https://gist.github.com/lbustelo/18740343028cb34a8753

@lbustelo
Copy link
Collaborator

lbustelo commented Mar 2, 2016

Having said that... there might be a fix necessary on urth-core-function to get notified of deep changes in an argument (array or object)

@lbustelo
Copy link
Collaborator

lbustelo commented Mar 2, 2016

A workaround to get the function called on multi selection is to use the args property of urth-core-function. Would look something like this

%%html
<template is="urth-core-bind">
    <urth-core-function ref="test" args="{{theArgs}}" result="{{theResult}}" auto></urth-core-function>

    <paper-menu attr-for-selected="label" multi selected-values="{{theArgs.items}}">
        <paper-item label="1">Network 1</paper-item>
        <paper-item label="2">Network 2</paper-item>
        <paper-item label="3">Network 3</paper-item>
    </paper-menu>

    The function result <span>{{theResult}}</span><br/>

</template>

As for using the other style of passing arguments... that is a real issue. Need to investigate how to support it.

@lbustelo
Copy link
Collaborator

lbustelo commented Mar 2, 2016

Another potential workaround is to wrap the 'urth-core-functionwith an 'urth-core-watch and then use the arg-<param name> approach.

%%html
<template is="urth-core-bind">
    <urth-core-watch value="{{selections}}">
        <urth-core-function ref="test" arg-items="{{selections}}" result="{{theResult}}"></urth-core-function>
    </urth-core-watch>
    <paper-menu attr-for-selected="label" multi selected-values="{{selections}}">
        <paper-item label="1">Network 1</paper-item>
        <paper-item label="2">Network 2</paper-item>
        <paper-item label="3">Network 3</paper-item>
    </paper-menu>

    The function result <span>{{theResult}}</span><br/>

</template>

@lbustelo
Copy link
Collaborator

lbustelo commented Mar 4, 2016

fixed by #249

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

No branches or pull requests

2 participants