Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
BeanItemContainer cannot be resolved to a type
I am completing the backend tutorial and have the following error
https://vaadin.com/docs/-/part/framework/tutorial.html#framework.tutorial.backend
BeanItemContainer cannot be resolved to a type
grid.setContainerDataSource(new BeanItemContainer<>(Customer.class, customers));
Any suggestions greatly appreciated.
Video notes
https://www.useloom.com/share/508e9dc120dc482aaa7415485b2c4c5c
package com.duelchem;
import java.util.List;
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Button;
import com.vaadin.ui.Grid;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
import com.vaadin.ui.TextField;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
/**
* This UI is the application entry point. A UI may either represent a browser window
* (or tab) or some part of a html page where a Vaadin application is embedded.
* <p>
* The UI is initialized using {@link #init(VaadinRequest)}. This method is intended to be
* overridden to add component to the user interface and initialize non-component functionality.
*/
@Theme("mytheme")
public class MyUI extends UI {
private CustomerService service = CustomerService.getInstance();
private Grid grid = new Grid();
@Override
protected void init(VaadinRequest vaadinRequest) {
VerticalLayout layout = new VerticalLayout();
layout.addComponent(grid);
updateList();
layout.setMargin(true);
layout.setSpacing(true);
setContent(layout);
}
public void updateList() {
List<Customer> customers = service.findAll();
grid.setContainerDataSource(new BeanItemContainer<>(Customer.class, customers));
}
@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {
}
}
If you are using Vaadin 8, there were recently major changes in the binding-area
Thank you, yes, I did use Vaadin 8.
How can one discern between all the tutorials that conflict with version 8 ?
Hi Nicklas,
My focus is to acquire an understanding of Vaadin. I have a two week trial for Vaadin Designer 8 and the same tutorial that uses Vaadin 7 is not compatible with Vaadin Designer 8. Please, can you share an updated tutorial link to your MAIN first tutorial:
" This video is built with Vaadin Framework 7. There are some small differences if you use the latest version."
Are the videos Vaadin 7 and the instructions for Vaadin 8 ?
Hi,
Yes, instructions are for Vaadin 8. Some of the videos are almost the same, but you cannot follow them exactly. Skip the videos at this point and focus on written tutorial. The updated video tutorials are under construction, hopefully at least most of them will be published soon.
cheers,
matti
Thank you, does this also apply to the post I just made regarding the error?
I think something was left out between step 6 and step 7, as the grid is not connecting to the edit fields on the form.
You can just call the grid.setItems(myCollection) and then do grid.addColumn(Entity::getSomething)
Thank you. I have started over again, and this time with Vaadin 8, hoping the written instructions are accurate for the MAIN BEGINNERS tutorial.
Jon A: Hi Nicklas,
My focus is to acquire an understanding of Vaadin. I have a two week trial for Vaadin Designer 8 and the same
The documentation (or the Book of Vaadin) is quite good so it should be pretty easy to get started even if you're not using Designer...
Thank you. Shall try to find the link for the Book of Vaadin right now. As I have been trying to complete, since yesterday:
https://vaadin.com/docs/-/part/framework/tutorial.html
Found it, PDF.
Matti Tahvonen: Hi,
Yes, instructions are for Vaadin 8. Some of the videos are almost the same, but you cannot follow them exactly. Skip the videos at this point and focus on written tutorial. The updated video tutorials are under construction, hopefully at least most of them will be published soon.
cheers,
matti
Hi Matti, been watching a few of your videos.
Hope to finally be able to populate a Vaadin Grid with remote data today.