package com.accesspoint.vaadin3;
import com.vaadin.annotations.Theme;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
@Theme("mytheme")
public class HLTest extends UI
{
private static String SHOW_MRC_COSTS = "Display MRC Margin & Cost";
private static String SHOW_NRC_CHARGES = "Display NRCs";
@Override
protected void init(VaadinRequest request)
{
final VerticalLayout pageLayout = new VerticalLayout();
CheckBox showCostCheckBox = new CheckBox(SHOW_MRC_COSTS);
CheckBox showNrcCheckBox = new CheckBox(SHOW_NRC_CHARGES);
showCostCheckBox.setValue(false);
showNrcCheckBox.setValue(false);
Layout checkBoxLayout = new VerticalLayout();
checkBoxLayout.addComponents(showCostCheckBox, showNrcCheckBox);
HorizontalLayout hl = new HorizontalLayout();
Label l = new Label("1st component");
CheckBox cb = new CheckBox("2nd component");
hl.addComponents(l, checkBoxLayout, cb);
pageLayout.addComponents(hl);
setContent(pageLayout);
}
}
Did a clean and build within netbeans (can’t find the maven build “run as” options), and get output as in the attachment (sorry, don’t have a server to put it on). There is no space at all between the components horizontally, but more frustrating is that the checkboxes are all checked, and I cannot uncheck them by clicking on them.
This can’t be the default. If I remove the “@Theme” line, I get much smaller components that work properly and have a little space between them.
(I took out all the commented-out lines at the start; hopefully they don’t do anything)
Whether I use @Theme(“mytheme”) or @Theme(“valo”) the result is the same; the checkboxes are checked and remain that way regardless of what I click on.
Well, thanks for the effort and the notification; wonder what strange thing I’ve got in my environment/code/head/whatever that causes this. If I figure out an actual cause I’ll post back…