77import com .google .gwt .user .client .ui .Composite ;
88import com .google .gwt .user .client .ui .HTMLPanel ;
99import com .vaadin .polymer .Polymer ;
10- import com .vaadin .polymer .elemental .Function ;
1110import com .vaadin .polymer .elemental .HTMLElement ;
1211import com .vaadin .polymer .elemental .NodeList ;
1312import com .vaadin .polymer .elemental .Template ;
@@ -35,7 +34,7 @@ public IronInputSample() {
3534 initWidget (ourUiBinder .createAndBindUi (this ));
3635
3736 // Wait until the template has been rendered by polymer to query the dom.
38- Polymer .whenReady ( o -> {
37+ Polymer .ready ( bindTemplate , o -> {
3938 NodeList inputs = ((HTMLElement )getElement ()).querySelectorAll ("input" );
4039 ironInput = inputs .item (0 );
4140 input1 = inputs .item (1 );
@@ -44,17 +43,15 @@ public IronInputSample() {
4443 });
4544
4645 // Bind functions to the template
47- Polymer .property (bindTemplate , "function1" ,
48- (Function <?,?>) e -> {
49- ironInput .setBindValue (input1 .getValue ());
50- return null ;
51- });
52- Polymer .property (bindTemplate , "function2" ,
53- (Function <?,?>) e -> {
54- // TODO: casting because api-generator does not support extending
55- // native elements yet, hence we use gwt input.value instead.
56- ((InputElement )ironInput ).setValue (input2 .getValue ());
57- return null ;
58- });
46+ Polymer .function (bindTemplate , "function1" , o -> {
47+ ironInput .setBindValue (input1 .getValue ());
48+ return null ;
49+ });
50+ Polymer .function (bindTemplate , "function2" , o -> {
51+ // TODO: casting because api-generator does not support extending
52+ // native elements yet, hence we use gwt input.value instead.
53+ ((InputElement ) ironInput ).setValue (input2 .getValue ());
54+ return null ;
55+ });
5956 }
6057}
0 commit comments