gwt-polymer-elements icon indicating copy to clipboard operation
gwt-polymer-elements copied to clipboard

Extend GWT functionality

Open anton-johansson opened this issue 9 years ago • 2 comments

Hi!

This project looks interesting! But like other Material Design/Polymer GWT wrappers I've seen, some of the widgets lack GWT functionality. Take a look at GWT's built in TextBox for example. It implements a bunch of interfaces, for example:

  • HasChangeHandlers
  • HasText
  • HasValue<String>
  • IsEditor<ValueBoxEditor<String>
  • etc

PaperInput does not implement these interfaces. This makes it harder to work with the widget. For example, if you use a framework such as tessell, it's crucial to implement these interfaces, in order to do proper 2-way bindings.

Are there any plans regarding this?

Thanks!

anton-johansson avatar Jul 14 '15 08:07 anton-johansson

Actually we have not thought on that. We have the mechanism to implement customised behaviours per element, but first we have to consider if there is interest on certain features. Could you enumerate which interfaces would be fundamental for you and in which web components?. Anyway those customisations only can be perform in Widgets, not Elements.

manolo avatar Jul 14 '15 16:07 manolo

Well, I would like to see most of the native interfaces being implemented. But there are of course some that are more important than others. If we take TextBox again, for example, the most important ones would be HasValue<String>, HasEnabled and HasChangeHandlers, I think. The value and the enabled status are things that you would most likely bind to a model.

If people would like to use the new GWT Editor framework, I assume the widget would have to implement IsEditor<ValueBoxEditor<String>> as well.

If we look at CheckBox, we would again need the most vital ones, HasValue<Boolean>, HasEnabled and IsEditor<LeafValueEditor<Boolean>> for editors.

But if you take a look at the GWT native class, FocusWidget, that many widgets extend, you will see a lot of interfaces that are very useful.

These are just ideas, it's much easier to use the widgets if they work like regular GWT widgets.

About it only working on Widgets, yeah, that might be the case. I'm not very familiar of using Elements directly, as mentioned in the "Element vs Widget API" section of the readme.

anton-johansson avatar Jul 15 '15 08:07 anton-johansson