@SpringComponent
@SpringUI(path = "/demo")
public class MyUI extends UI {
HorizontalLayout layout = new HorizontalLayout();
GridBasedCrudComponent<UserBean> crud = new GridBasedCrudComponent<>(UserBean.class);
@Override
protected void init(VaadinRequest request) {
crud.setFindAllOperation(() -> UserBean.getSome());
layout.addComponent(crud);
setContent(layout);
}
public static class UserBean {
private String givenName;
private String surName;
public UserBean(String givenName, String surName) {
this.givenName = givenName;
this.surName = surName;
}
public static List<UserBean> getSome() {
return Arrays.asList(
new UserBean("Tom","Hansen")
, new UserBean("Odd", "Jensen")
);
}
public String getGivenName() {
return givenName;
}
public void setGivenName(String givenName) {
this.givenName = givenName;
}
public String getSurName() {
return surName;
}
public void setSurName(String surName) {
this.surName = surName;
}
}
}
`
I think this is as minimalistic as can be. Values are not shown in the grid, though. On reload the notification shows that two rows are found. But the grid is just blank. Is this due to 2.1.0 not being released yet?
grid.setItems(items); in GridBasedCrudComponent do happen in the debugger, and items is of size 2 as expected, so it's a bit weird.
I have a spring-boot program (version 1.5.2) and have added an UI
` package com.example;
import com.vaadin.server.VaadinRequest; import com.vaadin.spring.annotation.SpringComponent; import com.vaadin.spring.annotation.SpringUI; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.UI; import org.vaadin.crudui.crud.impl.GridBasedCrudComponent;
import java.util.Arrays; import java.util.List;
@SpringComponent @SpringUI(path = "/demo") public class MyUI extends UI {
} `
I think this is as minimalistic as can be. Values are not shown in the grid, though. On reload the notification shows that two rows are found. But the grid is just blank. Is this due to 2.1.0 not being released yet?
grid.setItems(items); in GridBasedCrudComponent do happen in the debugger, and items is of size 2 as expected, so it's a bit weird.