I need to add/remove/customize columns from a Vaadin Grid which contains auto generated jooq records.
BeanItemContainer<MyJooqRecord> beanItemContainer;
beanItemContainer = DBUtil.getAll();
Grid grid = new Grid();
grid.setContainerDataSource(beanItemContainer);
now I like to (for example) add a Button.
grid.addColumn("Action", Button.class).setRenderer(
new ButtonRenderer(new RendererClickListener() {
@Override
public void click(RendererClickEvent event) {
//code ...
}
}
));
result:
2016-11-30 10:39:17,950 [http-nio-8080-exec-2] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] [DirectJDKLog.java:181] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [com.vaadin.server.ServiceException: java.lang.IllegalStateException: Container for this Grid is not a default container from Grid() constructor] with root cause
java.lang.IllegalStateException: Container for this Grid is not a default container from Grid() constructor
with Vaadin Tables it just works fine. But after reading this I like to use Grids
The reason why this happens I found here
How to write a Container with simple Beans I found here
How can I achieve that with jooq records?
any advice please
Java 1.7 - Vaadin 7.7.3