Friday, June 7, 2013

TabLayoutPanel get index of tab which added a special widget

Hi,

I'm struggling getting the index of a tab in a TabLayoutPanel. I am working on legacy code so no big chance changing panel types and stuff.

Code looks like this:

TabLayoutPanel tabLayoutPanel = new TabLayoutPanel();

MyView myView = new MyView();

tabLayoutPanel.add(myView , "Tab name");

Later I need to select the right tab.

tabPanel.selectTab(3);

At the moment the tab containing myView is the fourth which is added but I want to avoid magic numbers.

Is there an appropriate way to get the tab's index which contains myView? I tried searching by widget but without success.

May be not a big question but till now my attempts failed. Today is not my day.

Thanks in advance.

Best regards

Jochen

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments:

Post a Comment