Arguments to functions in data-binding must be the names of data-bound properties: https://www.polymer-project.org/1.0/docs/devguide/data-binding.html#annotated-computed
I'd also suggest not trying to change the id or on-click bindings like that, but instead place a new attribute on paper-button with your computed binding. Then the "validate" function can be a lot simpler: http://jsbin.com/baxucesusa/edit?html,console,output On Sun, Sep 20, 2015 at 10:24 PM, toduu <[email protected]> wrote: > String concatenation is not supported inside a tag, and the tag can’t > contain any whitespace. This limitation is hampering. > > The moment you do auto format in an ide like eclipse the whole thing gets > messed up because spaces get inserted. > > All the function writing one has to do to overcome this limitation also > adds more javascript to the code. > > Also I was unable to pass data binding to a function. > > e.g. I have a iron-list with items which are paper-cards that have > paper-button . While setting id based on a function works passing it to > another function validate fails ... > > Any suggestions? > > <iron-list id="alist" as="item" indexAs="index" auto> > <template> > <a-card que="[[item]]" index="[[index]]"></a-card> > > </template> > > </iron-list> > > > <dom-module id="a-card"> > > ... > > <paper-card > > > <div class="card-content"> > > <paper-button raised id="{{_ans('W',que)}}" on-click= > "validate({{_ans('W',que)}})"> > > .. > > <paper-card > > > <script> > > Polymer({ > > is : 'a-card', > > properties : { > > que : Object > > }, > > _ans : function(ans, que) { > > return 'xx_' + ans + que.queNum; > > } > > > }); > > > function validate(option) { > > console.log(option); > > }; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > </script> > > > > > 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/a8b38417-1728-4544-a39a-f17d45f2adda%40googlegroups.com > <https://groups.google.com/d/msgid/polymer-dev/a8b38417-1728-4544-a39a-f17d45f2adda%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/CAAUAVAj3zeqY421VV%3DYMXZKdO7-E-7vWV_t-nnyWtTUBmFXr0w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
