Loading...
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.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

HorizontalSplitPanel does not consider rigth component for the size

Martin Letendre
9 years ago Apr 16, 2012 5:48pm
Problem

HorizontalSplitPanel does not consider right component for the size

If you put two component a left component (ListSelect) an right component (TreeTable) in an HorizontalSplitPanel: The size of the right component is not considered.

Suggestions ?

-------------------------------------------------------------------------

Vaadin Version 6.7.6

-------------------------------------------------------------------------
Here is an example:

package com.release5.torvis.application;

import java.util.Arrays;
import java.util.List;

import com.vaadin.Application;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TreeTable;
import com.vaadin.ui.Window;

public class ResizeVerticalPanel extends Application {

	private TreeTable treetable = new TreeTable();

	private TabSheet panel = new TabSheet();

	private HorizontalSplitPanel horizontalLayout = new HorizontalSplitPanel();

	private static final String[] NAMES = new String[] { "Lehtinen", "Sara",
			"Koivuviita", "Grönroos", "Jansson", "Tahven", "Englund",
			"Anonymous", "Ekblad", "Kronqvist", "Leppänen", "Kerola", "Clerc",
			"Muurimaa", "Ahlroos", "Pöntelin", "Raneti", "Laakso", "Schild",
			"Kurki" };

	private static final List<String> cities = Arrays.asList(new String[] {
			"Berlin", "Brussels", "Helsinki", "Montreal", "Oslo", "Paris",
			"Stockholm" });

	@Override
	public void init() {
		Window window = new Window();

		setMainWindow(window);
		window.addComponent(panel);
		panel.setSizeFull();

		panel.addTab(horizontalLayout, "MyTab");
		horizontalLayout.setHeight("100%");

		// column 1
		addColumn1();

		// column 2
		addColumn2();
	}

	private void addColumn1() {

		ListSelect citySelect = new ListSelect("Please select a city", cities);
		horizontalLayout.addComponent(citySelect);

	}

	private void addColumn2() {
		horizontalLayout.addComponent(treetable);
		treetable.setPageLength(0);
		treetable.setHeight("100%");
		treetable.addContainerProperty("name", String.class, "AA");
		for (String name : NAMES) {
			treetable.addItem(new Object[] { name });
		}
	}

}
Last updated on Apr, 16th 2012
cuneyt ozen
9 years ago May 30, 2012 7:52pm
Anky S.
7 years ago Sep 05, 2014 1:02pm
Henri Sara
7 years ago Sep 08, 2014 6:41am
Anky S.
7 years ago Sep 08, 2014 11:05am
Henri Sara
7 years ago Sep 09, 2014 7:12am