import com.vaadin.server.UserError;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractField;
+import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
baseLayout.addComponent(button3);
baseLayout.addComponent(button4);
baseLayout.addComponent(glo);
+ // Don't expand the buttons
+ ((AbstractOrderedLayout) baseLayout).setExpandRatio(glo, 1);
+
button1.setEnabled(true);
button2.setEnabled(false);
button3.setEnabled(false);
baseLayout.addComponent(glo);
+ // Don't expand the buttons
+ ((AbstractOrderedLayout) baseLayout).setExpandRatio(glo, 1);
+
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
@Override
public void buttonClick(ClickEvent event) {
vlo.setSizeUndefined();
- vlo.addComponent(new Label("--- NEW LABEL ---"));
+ Label label = new Label("--- NEW LABEL ---");
+ label.setWidth(null);
+ vlo.addComponent(label);
button2.setEnabled(false);
button3.setEnabled(true);
}
final VerticalLayout vlo = getTestLaytout();
final VerticalLayout vlo2 = getTestLaytout();
+ // Set undefined height to avoid expanding
+ vlo2.setHeight(null);
+
final HorizontalLayout source = new HorizontalLayout();
source.addComponent(new Label("OTHER LABEL 1"));
source.addComponent(new Label("OTHER LABEL 2"));