wicket-jquery-ui
wicket-jquery-ui copied to clipboard
TabbedPanel: When setActiveTab is called onActivate will always return that index
Seb,
Just noticed this issue. Just to give the scenario; I have a page, with a tabbed panel. As the user selects tabs, I store the selected tab index. When the user reloads the page, I reset the last selected tab index in setActiveTab(index) so that the user re-opens the page on the last selected tab.
Trouble is, from that reload, once setActiveTab() is called, onActivate will always return that index as it's index. So from that point I have no idea which tab they've actually selected.
Cheers, Col.
Worth noting that if you set the tab via Options, it has the same behaviour.
Hi Colin,
Is it the jQuery UI or Kendo UI TabbedPanel ? I'm trying to look into it today...
Thanks Sebastien.
Hi Colin,
I tried to reproduce your issue but its working for me (I presumed you are using the jQuery UI TabbledPanel). When I come back in the page, the correct tab is selected, and when I click antoher one, the correct index is retrieved. Are you sure you are using #onActivate
and not #onActivating
?
Here is the code I used:
this.tabPanel = new TabbedPanel("tabs", this.newTabModel()) {
private static final long serialVersionUID = 1L;
@Override
protected void onConfigure()
{
super.onConfigure();
this.setActiveTab(SampleSession.get().tabIndex);
}
@Override
public void onActivate(AjaxRequestTarget target, int index, ITab tab)
{
SampleSession.get().tabIndex = index;
this.info("selected tab #" + index);
target.add(feedback);
}
}
Please create a quickstart so I can actually reproduce your issue! :)
Thanks & best regards, Sebastien.
Definitely using onActivate - I'll knock out a quickstart and see if I can replicate it.