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 {
}
}
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 ?
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.