PDA

View Full Version : TabItem setClosable() problem



francescoNemesi
20 Mar 2009, 2:09 AM
Hi There,

I have a TabPanel, its TabItems are created dynamically and are set to closable with setClosable(true). Every time the user deletes a TabItem I perform a check to see how many TabItems are in the TabPanel, if only one TabItem is left I want to change its closable state to false, I do this with

tabItem.setClosable(false);
tabItem.layout();

but the close button does not disappear... I know I could use the BeforeRemove event, but I'd rather eliminate the close button altogether.

Any ideas?

Thanks

fother
20 Mar 2009, 5:35 AM
you need set closable before render

francescoNemesi
20 Mar 2009, 5:59 AM
Hi,

yep, thought so, only the tab is already rendered when I want to change its closable state... re-render it would be a nightmare as it would contain other widgets...

Looks like I'm stuck with the BeforeRemove event.

Thanks a lot for your reply