Buy me a coffee :)

Wicket - jQuery UI

jQuery UI integration in Wicket 6.x, Wicket 7.x , Wicket 8.x & Wicket 9.x

Vertical Menu based on Superfish

Components / Samples

Description

Since

wicket-jquery-ui-core-6.11.1

Sources

package com.googlecode.wicket.jquery.ui.samples.jqueryui.plugins.sfmenu;

import java.util.List;

import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.util.lang.Generics;

import com.googlecode.wicket.jquery.ui.panel.JQueryFeedbackPanel;
import com.googlecode.wicket.jquery.ui.plugins.sfmenu.ISfMenuItem;
import com.googlecode.wicket.jquery.ui.plugins.sfmenu.SfMenu;
import com.googlecode.wicket.jquery.ui.plugins.sfmenu.SfMenuItem;
import com.googlecode.wicket.jquery.ui.samples.HomePage;
import com.googlecode.wicket.jquery.ui.samples.jqueryui.accordion.DefaultAccordionPage;
import com.googlecode.wicket.jquery.ui.samples.jqueryui.button.DefaultButtonPage;
import com.googlecode.wicket.jquery.ui.samples.jqueryui.datepicker.DefaultDatePickerPage;
import com.googlecode.wicket.jquery.ui.samples.kendoui.editor.DefaultEditorPage;

public class VerticalSfMenuPage extends AbstractSfMenuPage
{
	private static final long serialVersionUID = 1L;

	static List<ISfMenuItem> newSfMenuItemList()
	{
		List<ISfMenuItem> list = Generics.newArrayList();

		list.add(new SfMenuItem("Home", HomePage.class));
		list.add(new SfMenuItem("Widgets", widgetSubMenuList()));
		list.add(new SfMenuItem("Another Way Home", HomePage.class));
		list.add(new SfMenuItem("Second Sub-menu", newSubMenuList()));
		list.add(new SfMenuItem("Kendo Editor", DefaultEditorPage.class));

		return list;
	}

	static List<ISfMenuItem> newSubMenuList()
	{
		List<ISfMenuItem> list = Generics.newArrayList();

		list.add(new SfMenuItem("Sub-menu #1", HomePage.class));
		list.add(new SfMenuItem("Sub-menu #2", HomePage.class));
		list.add(new SfMenuItem("Sub-menu #3", HomePage.class));

		return list;
	}

	static List<ISfMenuItem> widgetSubMenuList()
	{
		List<ISfMenuItem> list = Generics.newArrayList();

		list.add(new SfMenuItem("Accordion", DefaultAccordionPage.class));
		list.add(new SfMenuItem("Button", DefaultButtonPage.class));
		list.add(new SfMenuItem("Datepicker", DefaultDatePickerPage.class));

		return list;
	}


	public VerticalSfMenuPage()
	{
		// FeedbackPanel //
		final FeedbackPanel feedback = new JQueryFeedbackPanel("feedback");
		this.add(feedback.setOutputMarkupId(true));

		// Menu //
		this.add(new SfMenu("menu", VerticalSfMenuPage.newSfMenuItemList(), true));
	}
}
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<head>
<wicket:head>
	<title>Wicket jQuery UI: Menu</title>
</wicket:head>
</head>
<body>
<wicket:extend>
	<div id="demo-panel" wicket:id="menu" style="min-height: 180px;"></div>
	<br/>
	<div wicket:id="feedback" style="width: 360px;"></div>
</wicket:extend>
</body>
</html>