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.
With the code given in the earlier post (with setHeight(“100%”) for the right hand component), the second component shouldn’t affect the height of the splitpane, so I believe Vaadin behaves as it should as far as I can understand the description of the problem. I didn’t test the code, though, and the post does not give a screenshot on what is wrong.
If with a valid layout there is a problem with the latest stable release (currently 7.3.0), please
create a ticket with a minimal UI class that permits reproducing the problem.
I just might be to studip to login to trac or to register.
But here is what I’ve found out about this problem:
With Valo and Vaadin 7.3 the HorizontalSplitPanel looks fine.
With Reindeer and Vaadin 7.3 it doesn’t, see attachment.
What to see here: there should be two Labels on the right side and the HorizontalSplitPanel should be high enough to display these.
Here the minimal code:
package com.example.testsplitpanel;
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.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
@SuppressWarnings("serial")
@Theme("reindeer")
public class TestsplitpanelUI extends UI {
@WebServlet(value = "/*", asyncSupported = true)
@VaadinServletConfiguration(productionMode = false, ui = TestsplitpanelUI.class)
public static class Servlet extends VaadinServlet {
}
@Override
protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
setContent(layout);
VerticalLayout labelsLayout = new VerticalLayout(new Label("Label one"), new Label("Label two"));
HorizontalSplitPanel hsplit = new HorizontalSplitPanel();
hsplit.setWidth("100%");
hsplit.addComponent(new Label("I'm just a Label"));
hsplit.addComponent(labelsLayout);
Panel panel = new Panel();
panel.setWidth("100%");
panel.setContent(hsplit);
layout.addComponent(panel);
}
}
It looks like the outer Panel is redundant, it is enough to have one outer container with undefined height. The left hand side of the split panel affects the height of an undefined height HorizontalSplitPanel, the right hand side doesn’t when using reindeer but does with valo. I don’t know if VerticalSplitPanel has similar issues with respect to its width.