Nested DDTabSheet refresh ?


I’m trying to make some kind of tiny GUI editor using dragdroplayouts add-on, and actually partly succeeded. One of the requested features is to add tabs/accordion to the main layout, which is done by dropping special labels :
when a “tab” label is dropped on the main layout, a new TabSheet is created as main layout, and the existing layout is added as first tab
so far, this works fine :slight_smile:

the problem appears when main layout is alreay a TabSheet (T1), and a new “tab” label is dropped on one of its tab content (C) : as expected, another TabSheet (T2) is created, and previous content of T1’s tab (C) added in T2 first tab (hope this is clear despite my poor english, sorrry;))
the point is, although T2 header appears, C is not displayed, unless I refresh the whole page :frowning:
all layouts have been set to immediate mode
I also tried to call requestRepaint() on T1 or T2 (although somewhere in this forum it’s been said one should never call this directly), without any improvement
tried to analyse layouts using debug mode, but since this refreshes page, the problem disappear before I’m able to inspect it :frowning: - no layout errors on the application window, by the way-.

my last hope is to have made a newbie mistake, and some of you will tell me what it is :slight_smile:
many thanks,

Hi again,

took some time to make further tests, and got a minimal sample showing the problem :

	final VerticalLayout mainLayout = new VerticalLayout();
	Button b = new Button("Add tabsheet");
	b.addListener(new Button.ClickListener() {
		public void buttonClick(ClickEvent event) {
			TabSheet tabsheet = new TabSheet();
			ComponentContainer mainParent = (ComponentContainer) mainLayout.getParent();
			mainParent.replaceComponent(mainLayout, tabsheet);
			tabsheet.addTab(mainLayout, "Default tab");
	helpLayout.addComponent (b);
	mainLayout.addComponent(new Label ("This is main layout"));
	helpLayout.setExpandRatio(b, 0);
	helpLayout.setExpandRatio(mainLayout, 1);

does anyone know what is missing in this code ? :frowning:


What version of Vaadin are you using?

If you’re not using the newest (Vaadin 6.7.3) then I suggest you update. If I remember correctly pre Vaadin 6.7.1 Tabsheet has a serious rendering bug when replacing tabs dynamically which would manifest in the way you describe.

Okay, played around with your testcase and indeed, it is an bug in the latest Vaadin (6.7.3) as well. Created an issue
about the bug in the Vaadin trac.

well, you were too fast for me too reply :wink:
indeed, I’m using 6.7.3 (upgraded when encountered bug)
thanks for your help, and by the way thanks for vaadin (think I forgot to say that in previous posts) which is a great achievment :slight_smile: