tags:

views:

526

answers:

3

Hi,

I Am trying to create a Tab Panel where I can add and delete tabs on demand.

Where I am getting stuck is that if a potential user adds too many tabs the new tabs go off the screen.

Each Tab is to contain a text area widget where a user may enter text.

Is there any way of horizontally scrolling the just the TabBar and not the whole browser window?

I could use a scroll panel but I was hoping to scrol just the Tabs, not the panel contents.

I cannot see any available method in the com.google.gwt.user.client.ui.TabPanel API that will perform this function and no real way to split the panel.

Help!

A: 

It's not what you've asked for, but you might consider using a StackPanel instead of a TabPanel, since if the user can enter a long list of items it's generally better to have vertical scrolling instead of horizontal scrolling.

aem
A: 

The gwt TabPanel isn't the greatest, and there's not a real easy way to do what you want. You could take a look at the tab widget in Ext-GWT, which scrolls the tabs, but I don't think extjs is generally a good idea.

There's a bunch of new layout-based widgets arriving with GWT 2.0. Look at TabLayoutPanel. It places tabs in a very wide container inside a div with overflow=hidden. You might be able to add some controls to scroll that container and get the effect you want.

Good luck, and report back if you get something working. GWT really needs more widget contributors.

spankalee
TabLayoutPanel has really bad support. I had to do some very hackish things just to get it to partially work.
antony.trupe
A: 

Hi I also have a similar requirement I have achieved adding tabs on demand but I need scrollable tabs. Is there any way to add that functionality to the existing gwt tabpanel widget?