views:

13

answers:

0

All, I want a tab menu pane that lives inside my main ScrollPanel. Everytime a user clicks a menu option from my main page the centre ScrollPanel removes whatever widgit was there before and adds a new one.

Its worked fine so far that is until i introduced a TabLayoutPanel. As you guessed it the TabLayout only shows the tabs and not the content which has no size and yes i want it at 100% width and height.

Ive seen this all over the interweb and the solution is to attached it to the RoolLayoutPanel because the TabLayoutPanel is set to absolute however that doesnt work for me because i dont want to attach it to the root layout rather this inner client area/ ScrollPanel.

All i want is a tabbed system so if TabLayoutPanel is not the best choice then does anyone recommend another? Im in standards mode as i assume that i should be building against this for better browser compatibility.

here is my page structure:

RootLayoutPanel rootPanel = RootLayoutPanel.get();
rootPanel.setSize("940px", "940px");

mainpanel = new FlowPanel();
mainpanel.setSize("100%", "100%");
rootPanel.add(mainpanel);

header = new FlowPanel();
mainpanel.add(header);

ScrollPanel mainbody = new ScrollPanel();
mainpanel.add(mainbody);

footer = new FlowPanel();
mainpanel.add(footer);

And whenever i want to change the content of mainbody i call:

mainbody.clear()
mainbody.add(..)

Any help would be appreciated, Thanks