Hi,
I have a class that extends AjaxTabbedPanel, it displays a busy indicator
while the ajax call is running (see code below). This all works fine during
these ajax calls; so a busy indicator is displayed and the tab that has been
selected is displayed correctly in the view. However, if the page is
refreshed the first tab in the group of tabs is shown as being selected and
the app forgets which tab was previously selected. To me it seems like the
initial page state for the tabs has been preserved and used again on
refreshing the page (a bit like it's a static model). I can't figure out
though what needs to be done to fix.
public class IndicatingAjaxTabbedPanel extends AjaxTabbedPanel {
private static final long serialVersionUID = 1L;
public IndicatingAjaxTabbedPanel(String id, List<ITab> tabs) {
super(id, tabs);
}
@SuppressWarnings("unchecked")
@Override
protected WebMarkupContainer newLink(String linkId, final int index) {
return new IndicatingAjaxFallbackLink(linkId) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target)
{
setSelectedTab(index);
if (target != null)
{
target.add(IndicatingAjaxTabbedPanel.this);
}
onAjaxUpdate(target);
}
};
}
}
Cheers.
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Class-that-extends-AjaxTabbedPanel-does-not-remember-selected-panel-on-page-refresh-tp4650642.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]