When you have a TabSheet with two tabs each of which containing a CheckBox and you switch between
these two tabs, the checkboxes will always show as deselected, no matter what their actual status is,
see attached code.
package com.example.checkboxtest;
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.CheckBox;
import com.vaadin.ui.Label;
import com.vaadin.ui.TabSheet;
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 an HTML page where a Vaadin application is embedded.
-
-
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 {@Override
protected void init(VaadinRequest vaadinRequest) {
final VerticalLayout layout = new VerticalLayout();
final TabSheet tabSheet = new TabSheet();tabSheet.addTab( new CheckBox( "Check me") ); tabSheet.addTab( new CheckBox( "Check me, too") ); layout.addComponents(tabSheet); setContent(layout);
}
@WebServlet(urlPatterns = “/*”, name = “MyUIServlet”, asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {
}
}