I'm using the "replace" branch.
I've got a view with a tab panel.
Selecting each tab updates the url. Example, clicking the first tab
changes reveals the first tab and the url correctly changes to:
http://127.0.0.1:8888/main.html?gwt.codesvr=127.0.0.1:9997#user;tab=0
Here's my code for that:
@Override
protected void onBind() {
display.getTabPanel().addSelectionHandler( new SelectionHandler() {
@Override
public void onSelection(SelectionEvent event) {
setCurrentTab(event.getSelectedItem().toString());
revealDisplay(currentTab, currentProjectId);
}
});
However, I can't use direct HREF's in my app. If I set a link to:
http://127.0.0.1:8888/main.html?gwt.codesvr=127.0.0.1:9997#user;tab=2
... the presenter won't go to tab 2. No problem, right? I'll just
programmatically select tab 2. However, if I add this:
@Override
protected void onRevealDisplay() {
if (this.currentTab.equals("2")) {
display.getTabePanel().selectTab(2);
... I end up in an infinite loop which crashes the browser. I can get
this to work by removing the "revealDisplay" call in my click Handler,
but then clicking the tabs doesn't work.
What's the best way to handle this?
Thanks!!