manolo / gwt-polymer-elements

Polymer Web Components for GWT. A collection of Material Design widgets for desktop and mobile.
Apache License 2.0
155 stars 49 forks source link

Extend GWT functionality #45

Open anton-johansson opened 8 years ago

anton-johansson commented 8 years ago

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:

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!

manolo commented 8 years ago

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.

anton-johansson commented 8 years ago

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.