Buy me a coffee :)

Wicket - jQuery UI

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

Effect Container

Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam. Integer ut neque. Vivamus nisi metus, molestie vel, gravida in, condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros. Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum a velit eu ante scelerisque vulputate.

Components / Samples

Description

The JQueryEffectContainer is a container on which effects can be played. It also triggers an event when the effect completes.

Sources

package com.googlecode.wicket.jquery.ui.samples.jqueryui.effect;

import java.util.Arrays;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.Model;

import com.googlecode.wicket.jquery.ui.JQueryUIBehavior;
import com.googlecode.wicket.jquery.ui.effect.Effect;
import com.googlecode.wicket.jquery.ui.effect.JQueryEffectContainer;
import com.googlecode.wicket.jquery.ui.form.button.AjaxButton;
import com.googlecode.wicket.kendo.ui.form.dropdown.DropDownList;

public class ContainerEffectPage extends AbstractEffectPage
{
	private static final long serialVersionUID = 1L;

	public ContainerEffectPage()
	{
		final JQueryEffectContainer container = new JQueryEffectContainer("container") {

			private static final long serialVersionUID = 1L;

			@Override
			public void onEffectComplete(AjaxRequestTarget target)
			{
				this.show(target);
			}
		};

		this.add(container.add(new JQueryUIBehavior("#tabs", "tabs")));

		Form<Void> form = new Form<Void>("form");
		this.add(form);

		// DropDownList //
		final DropDownList<Effect> dropdown = new DropDownList<Effect>("effects", Model.of(Effect.Explode), Arrays.asList(Effect.values()));
		form.add(dropdown);

		// Button //
		form.add(new AjaxButton("button") {

			private static final long serialVersionUID = 1L;

			@Override
			protected void onSubmit(AjaxRequestTarget target)
			{
				container.play(target, dropdown.getModelObject()); // Effect enum available since core 1.1
				// container.play(target, "fold"); //also available
			}
		});
	}
}
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<head>
<wicket:head>
	<title>Wicket jQuery UI: effect container</title>
</wicket:head>
</head>
<body>
<wicket:extend>
	<div wicket:id="container">
		<div id="tabs">
			<ul>
				<li><a href="#tab1">Tab 1</a></li>
			</ul>
			<div id="tab1">
				Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam.
				Integer ut neque. Vivamus nisi metus, molestie vel, gravida in,
				condimentum sit amet, nunc. Nam a nibh. Donec suscipit eros.
				Nam mi. Proin viverra leo ut odio. Curabitur malesuada. Vestibulum
				a velit eu ante scelerisque vulputate.
			</div>
		</div>
	</div>
	<br/>
	<form wicket:id="form">
		<button wicket:id="button">Play effect</button>
		<select wicket:id="effects"></select>
	</form>
</wicket:extend>
</body>
</html>