I want to create a dynamic tabbed panel in Apache Wicket 7.3 with AjaxTabs added and removed dynamically. To remove a tab, I want to add an [x] link to the tab header which sends the form on the tab panel for validation. If the form has validation errors, a dialog box shall open. I thought about extending TabbedPanel like this:
import com.googlecode.wicket.jquery.ui.widget.tabs.TabbedPanel;
public class MyTabbedPanel extends TabbedPanel {
???
<wicket:panel xmlns:wicket="http://wicket.apache.org">
<ul>
<li wicket:id="tabs">
<img wicket:id="icon" height="40" style="float:left" width="30">{icon}</img>
<a wicket:id="link" href="#">{link}</a>
<a wicket:id="closeTab" href="#" style="float:left;"
class="ui-icon ui-icon-close ui-icon-circle-close">(x)</a>
<div wicket:id="okCancelDialog">{okCancelDialog}</div>
</li>
</ul>
<div wicket:id="panels">{panels}</div>
</wicket:panel>
How can I add an AjaxSubmitLink to the Wicket-ID "closeTab"?
Which methods do I have to overwrite to add my link (and some other icons or stuff)?
Hi Hajo,
Adding or removing the tab is just matter of updating the tabmodel.
But, while adding is pretty simple (see the example on demo site), the remove thru the x-icon requires some additional dev because such behavior is not shipped by jquery-ui
Maybe the best would be to have a ClosableTab (and ClosableAjaxTab), so it simplifies users life ! :)
I don't think you can manage it by yourself for now, I guess you will not be able to specify something else than a label for the tab's title (so you cannot supply the icon, imo)
Please open an issue, I will try to update this asap.
Thanks and best regards,
Sebastien
Hi,
I am not sure to understant why you need a lazy load tab "title" panel... ajax lazy load is designed to lazy load slow content so the ui is not frozen...
I will have a look at this over the we, if my poor spare time allows it :/
Best regards,
Sebastien