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

VaadinGrid widget TypeError in Firefox #88

Closed cpboyd closed 8 years ago

cpboyd commented 8 years ago

I'm using the vaadin gwt-polymer-elements, so I'm not sure if this issue belongs here or on that project's issue tracker.

My code in GWT is:

VaadinGrid grid = new VaadinGrid("<table><colgroup>" +
        "<col name='k'/><col name='v'/></colgroup></table>");
grid.setItems(items);
grid.getHeader().setHidden(true);

The getHeader().setHidden(true) line causes an exception in Firefox but not in Chrome. Additionally, if I try to use getColumns(), I see a similar TypeError.

Here's the error that I have in the Firefox console:

Error: com.google.gwt.event.shared.UmbrellaException: Exception caught: (TypeError) : grid_0_g$.getHeader_4_g$(...) is undefined

Moreover, using grid.setItems(Object) resulted in an empty grid in Firefox (but not in Chrome).

Using UiBinder seems to work fine, but it'd be nice if I could get widgets to work as well.

cpboyd commented 8 years ago

This change worked:

VaadinGrid grid = new VaadinGrid("<table><colgroup>" +
        "<col name='k'/><col name='v'/></colgroup>" +
        "<thead hidden/></table>");
Polymer.ready(grid.getPolymerElement(), o -> {
        grid.setItems(items);
)};