Hi,
As a matter of fact, I'll have more than two TabLayoutPanel on one page. I'm trying to create a result page, and each result has a "Show details" link which opens a TabLayoutPanel that displays 2 tabs.
I simplified what I'm trying to achieve in a separated project, but I still can't get what I want...
Here's what I have:
public void onModuleLoad() {
Grid grid = new Grid(2, 1);
grid.setWidget(0, 0, createResult());
grid.setWidget(1, 0, createResult());
RootLayoutPanel.get().add(grid);
}
private Widget createResult() {
TabLayoutPanel details = new TabLayoutPanel(1.5, Unit.EM);
HTML contentFirst = new HTML("Lorem Ipsum is simply dummy text of the printing and"
+ "typesetting industry. Lorem Ipsum has been the"
+ " industry's standard dummy text ever since the 1500s,"
+ "when an unknown printer took a galley of type and scrambled" + "it to make a type specimen book."
+ "Lorem Ipsum is simply dummy text of the printing and"
+ "typesetting industry. Lorem Ipsum has been the"
+ " industry's standard dummy text ever since the 1500s,"
+ "when an unknown printer took a galley of type and scrambled" + "it to make a type specimen book.");
details.add(contentFirst, "First");
HTML contentSecond = new HTML("Content <b>bold</b>");
details.add(contentSecond, "Second");
details.setAnimationDuration(500);
details.setHeight("100%");
ResizeLayoutPanel detailsContainer = new ResizeLayoutPanel();
detailsContainer.add(details);
detailsContainer.setHeight("100%");
return detailsContainer;
}
When I set ReisizeLayoutPanel height to "100px", it displays the content of the tabs. However, when I set it to 100%, I can only see the two TabLayoutPanel headers (with the "First" and "Second" tab title). And the content varies from result to result, so I can't set a pixel height.
When I add the ResizeLayoutPanels returned by createResult() directly in RootLayoutPanel, they are overlying.
I also tried adding .gwt-TabLayoutPanel { height: 100%; } in my CSS.
I'm a bit out of ideas; do I need to add something other than HTML elements as widgets in the TabLayoutPanel? (I tried with LayoutPanel, SimplePanel..). I also tried using a FlowPanel instead of the grid, with no much success either.
Regards,
MChan