Crudui compatibility with last current version of vaadin 18.0.5…
As crudui use the method com.vaadin.flow.component.grid.Grid.setItems(java.util.Collection)
and that for this version it is not existent.
I got an exception:
Caused by: java.lang.NoSuchMethodError: com.vaadin.flow.component.grid.Grid.setItems(Ljava/util/Collection;)V
at org.vaadin.crudui.crud.impl.GridCrud.refreshGrid(GridCrud.java:122) ~[crudui-4.3.2.jar:4.3.2]
at org.vaadin.crudui.crud.impl.GridCrud.onAttach(GridCrud.java:91) ~[crudui-4.3.2.jar:4.3.2]
at com.vaadin.flow.component.ComponentUtil.onComponentAttach(ComponentUtil.java:230) ~[flow-server-5.0.2.jar:5.0.2]
at com.vaadin.flow.internal.nodefeature.ComponentMapping.lambda$onAttach$0(ComponentMapping.java:102) ~[flow-server-5.0.2.jar:5.0.2]
I am getting the same problem, cannot use the module with ComboBox (eg, an enum property) and Vaadin 18.0.5. From the discussion in https://github.com/vaadin/flow/issues/8831 the solution might be as simple as recompiling the add-on but I have not tried that yet. Any other solutions and suggestions are welcome!
Edit:
The solution I found for a combo box is to use something like this:
CrudFormEditorFactory<Price> factory = (CrudFormEditorFactory<Price>) crud.getCrudFormFactory();
factory.setFieldProvider("type", new FieldProvider<Component, PriceType>() {
@Override
public HasValueAndElement buildField() {
return new ComboBox<PriceType>("", PriceType.values());
}
});
java.lang.NoSuchMethodError: 'void com.vaadin.flow.component.grid.Grid.setItems(java.util.Collection)'
at org.vaadin.crudui.crud.impl.GridCrud.refreshGrid(GridCrud.java:122) ~[crudui-4.3.2.jar:4.3.2]
GridCrud.java:122
at org.vaadin.crudui.crud.impl.GridCrud.onAttach(GridCrud.java:91) ~[crudui-4.3.2.jar:4.3.2]
GridCrud.java:91
at com.vaadin.flow.component.ComponentUtil.onComponentAttach(ComponentUtil.java:230) ~[flow-server-5.0.2.jar:5.0.2]
ComponentUtil.java:230
at com.vaadin.flow.internal.nodefeature.ComponentMapping.lambda$onAttach$0(ComponentMapping.java:102) ~[flow-server-5.0.2.jar:5.0.2]
ComponentMapping.java:102
at java.base/java.util.Optional.ifPresent(Optional.java:183) ~[na:na]