Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Ajax-enhanced tabbed panel in Twitter bootstrap style for Wicket.
<wicket:panel xmlns:wicket="http://wicket.apache.org">
<div class="tabbable tabs-left" style="margin-right: 0; border-right: 0;">
<ul class="nav nav-tabs" style="margin-right: 0; border-right: 0;" wicket:id="tabs-container">
<li wicket:id="tabs">
<a data-toggle="tab" href="#" wicket:id="link"><span wicket:id="title">[tab title]</span></a>
</li>
</ul>
<div class="tab-content" style="min-height: 100%; padding-left: 20px; border-left: 1px solid #ddd;">
<div wicket:id="panel" class="tab-pane active">[tab]</div>
</div>
</div>
</wicket:panel>
import org.apache.wicket.extensions.ajax.markup.html.tabs.AjaxTabbedPanel;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.model.IModel;
import java.util.List;
public class AjaxTwitterBootstrapTabbedPanel<T extends ITab> extends AjaxTabbedPanel<T> {
public AjaxTwitterBootstrapTabbedPanel(String id, List<T> tabs) {
super(id, tabs);
}
public AjaxTwitterBootstrapTabbedPanel(String id, List<T> tabs, IModel<Integer> model) {
super(id, tabs, model);
}
@Override
protected String getSelectedTabCssClass() {
return "active";
}
@Override
protected String getTabContainerCssClass() {
return "nav nav-tabs";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment