I trying to use the vaadin-grid with my vaadin, but the only sample uses vaadin 8, can I use in vaadin 7?
this is the post with vaadin8 https://vaadin.com/blog/-/blogs/using-vaadin-elements-with-vaadin-framework
tks
I trying to use the vaadin-grid with my vaadin, but the only sample uses vaadin 8, can I use in vaadin 7?
this is the post with vaadin8 https://vaadin.com/blog/-/blogs/using-vaadin-elements-with-vaadin-framework
tks
In the
Directory page for Elements
, choose version 1.5.0 in the dropdown to the left. It is the last version for Vaadin Framework 7. I had a look on what changes was made going from 0.1.5 to FW8 supporting 0.2.0, and it seems to be only about HTMLImports.
Seems like in FW7 the API was
ElementIntegration.getRoot(wrapper).importHtml("VAADIN/bower_components/google-map/google-map.html");
while in FW8 it is the built in annotation
@HtmlImport("vaadin://bower_components/google-map/google-map.html")
Jens where I put the
ElementIntegration.getRoot(wrapper).importHtml(“VAADIN/bower_components/google-map/google-map.html”);
? in MyComponent constructor??
I want to use the grid have some sample?
tks
I tryng to does this:
@Tag("vaadin-grid") public interface VaadinGridElement extends Element {
static VaadinGridElement create() {
VaadinGridElement q = Elements.create(VaadinGridElement.class);
return q;
}
void setItems(String items);
}
public class VaadinGridComponent extends AbstractElementComponent {
VaadinGridElement element;
public static interface ValueChangeListener {
void valueChange(String option);
}
public VaadinGridComponent(String label, String... options) {
element = VaadinGridElement.create();
// ElementIntegration.getRoot(this).importHtml("VAADIN/bower_components/vaadin-grid/vaadin-grid.html");
if (options != null) {
JsonArray array = new JreJsonFactory().createArray();
for (int i = 0; i < options.length; i++) { array.set(i, options[i]
);
} element.setItems(array.toJson()); }
Root root = ElementIntegration.getRoot(this); root.appendChild(element); }
and in my UI
@com.vaadin.annotations.JavaScript("vaadin://bower_components/webcomponentsjs/webcomponents.js")
But I got the error:
Caused by: java.lang.ClassCastException: Cannot cast org.vaadin.elements.impl.ElementImpl$$EnhancerByCGLIB$$f795e5e7 to br.com.lumera.cartoriointeligente.ui.custom.VaadinGridElement
I have the same ClassCastException using vaadin 8.1, found any fix yet?