lmignon / GWTP-GXT3-SAMPLES

2 stars 1 forks source link

HyperLink dissapear when calling changeTab #3

Closed bprato closed 11 years ago

bprato commented 11 years ago

Using your sample implementation of tab system from GWTP with GXT3, i have discovered a little bug (i think).

In the changeTab method of the SimpleTabPanel class, you are calling the setText method on the tab object, and you only pass the label of the tabData and not an HyperLink.

So, after the changeTab method call, the hyperlink on the tab dissapear.

I found two possible solutions :

public void changeTab(Tab tab, TabData tabData, String historyToken) {
        tab.setTargetHistoryToken(historyToken);
        tab.setText(new Hyperlink(tabData.getLabel(), historyToken).toString());
    }

or

public void changeTab(Tab tab, TabData tabData, String historyToken) {
        tab.setTargetHistoryToken(historyToken);
        tab.setText(tabData.getLabel());
        ((SimpleTab)tab).activateHistoryToken();
    }

I can make a pull request with the fix if you wish.

lmignon commented 11 years ago

HI,

Thanks for the report...

2013/7/23 Benjamin Prato notifications@github.com

Using your sample implementation of tab system from GWTP with GXT3, i have discovered a little bug (i think).

In the changeTab method of the SimpleTabPanel class, you are calling the setText method on the tab object, and you only pass the label of the tabData and not an HyperLink.

So, after the changeTab method call, the hyperlink on the tab dissapear.

I found two possible solutions :

public void changeTab(Tab tab, TabData tabData, String historyToken) { tab.setTargetHistoryToken(historyToken); tab.setText(new Hyperlink(tabData.getLabel(), historyToken).toString()); }

or

public void changeTab(Tab tab, TabData tabData, String historyToken) { tab.setTargetHistoryToken(historyToken); tab.setText(tabData.getLabel()); ((SimpleTab)tab).activateHistoryToken(); }

I can make a pull request with the fix if you wish.

Yes, plz do-it...

— Reply to this email directly or view it on GitHubhttps://github.com/lmignon/GWTP-GXT3-SAMPLES/issues/3 .

lmi