Help with TabPanel - BeforeSelectionHandler (GWT 1.6)

34 views
Skip to first unread message

paul drussel

unread,
Feb 12, 2009, 11:38:16 AM2/12/09
to Google Web Toolkit
Hi,

I've started migrating my GWT app to 1.6 and would like some help on
how to implement the BeforeSelectionHandler for a TabPanel.

I need to run a method for the widget associated with the tab selected
before the tab is selected.

In essence, the previous code looked like this:

public class CharBurner implements TabListener {
private TabPanel tabpanel = new TabPanel();
public CBTab charpanel = new CBTab();
public CBTab summarypanel = new CBTab();

public CharBurner() {
tabpanel.add(charpanel, "Character");
tabpanel.add(summarypanel, "Summary");
tabpanel.addTabListener(this);
}

public boolean onBeforeTabSelected(SourcesTabEvents sender, int
tabIndex) {
((CBTab) tabpanel.getWidget(tabIndex)).refresh();
return true;
}
}

How would this be implemented using the new BeforeSelectionHandler /
BeforeSelectionEvent ?

Thanks in advance,
Paul
Reply all
Reply to author
Forward
0 new messages