Gabrielle
Gabrielle

Reputation: 840

Vaadin combobox value-changed not working

I am new with Polymer, I was trying to build an app using vaadin' combobox, but the value-changed event is never fired...

In my html I have:

<link rel="import" href="../../bower_components/polymer/polymer.html">

<link rel="import" href="../../bower_components/vaadin-combo-box/vaadin-combo-box.html">

<link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">

<dom-module id="fast-purchase-data">
<template>
<iron-ajax id="placesListAjax"  url="../mock-responses/places.json" last-response="{{places}}"></iron-ajax>
<vaadin-combo-box value-changed="valueChange" label="Places" class="combobox elements-box" items="[[places.data.elements]]" item-label-path="name"></vaadin-combo-box>
<iron-ajax id="eventsListAjax"  url="../mock-responses/events-list.json" last-response="{{resp}}" auto></iron-ajax>
<vaadin-combo-box value-changed="valueChange" label="Events" class="combobox" items="[[resp.data.elements]]" item-label-path="name"></vaadin-combo-box>
</template>

<script>


(function() {
'use strict';

Polymer({
is: 'fast-purchase-data',

valueChange: function(ev, i){
console.log("hey");
},
_pageChanged: function() {
this.$.placesListAjax.generateRequest();
},
});
})();
</script>
</dom-module>

I can see data in my combobox, but when I change its value I can't see the console.log neither an error. What am I missing?

Upvotes: 0

Views: 1331

Answers (1)

Maria
Maria

Reputation: 5604

The proper way to add event listeners declaratively is using on-event-name (docs). So in your case it should be as follows.

<vaadin-combo-box on-value-changed="valueChange" ></vaadin-combo-box>

Upvotes: 3

Related Questions