I previously had a BeanItemContainer for my Grid, but I needed to add a column in my grid for a button, so I used a GeneratedPropertyContainer.
But I’m getting the error:
Caused by: java.lang.ClassCastException: com.vaadin.data.util.GeneratedPropertyContainer$GeneratedPropertyItem cannot be cast to project.test.Bean
how do I get the Bean from GeneratedPropertyContainer?
For BeanItem Container, I could do this:
public class CustomCommit implements CommitHandler {
public CustomCommit() {
}
@Override
public void preCommit(CommitEvent commitEvent) throws CommitException {
BeanItem item = (BeanItem) commitEvent.getFieldBinder().getItemDataSource();
Bean bean = (Bean) item.getBean();
}
But for GPC I can’t figure out how to get the bean?