Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Tabsheet - Remembering last active tab

Madz R
9 years ago May 16, 2012 8:19am
E. Yildiz
9 years ago May 16, 2012 11:49am

Hi

if you could save the last active tabsheet caption, you could compare it with the other captions. For example:

String selectedTabSheet = tabSheet.getSelectedTab().getCaption();

after you reload the page you can do something like this:

final Iterator<Component> i = tabSheet.getComponentIterator();
						
while (i.hasNext())
{
	final Component c = i.next();
	final Tab tab = tabSheet.getTab(c);
	if (selectedTabSheet.equals(tab.getCaption()))
       {
		tabSheet.setSelectedTab(c);
	}
}

I dont know if this is the right way but it works.

Greets

Last updated on May, 16th 2012
Leif Åstrand
9 years ago Jun 06, 2012 10:55am