Buy me a coffee :)

Wicket - jQuery UI

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

Indicating Button



Components / Samples

Description

Since

wicket-kendo-ui-6.19.0

Licensing

Kendo UI "Core" is Apache License 2.0 licensed, starting from version 2014.1.416.
Prior to version 2014.1.416, Kendo UI "Web" was licensed under GPLv3.

A pro version - with a commercial license - is also available, it provides additional widgets (see http://docs.telerik.com/kendo-ui/intro/supporting/list-of-widgets)
To be able to use it, you need to change the ResourceReference with kendo.all.min.js

See also

[howto]-change-resource-references

Sources

  • Java
  • HTML
  • CSS
package com.googlecode.wicket.jquery.ui.samples.kendoui.button;

import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.form.Form;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.googlecode.wicket.kendo.ui.form.button.IndicatingAjaxButton;
import com.googlecode.wicket.kendo.ui.form.button.IndicatingButton;
import com.googlecode.wicket.kendo.ui.panel.KendoFeedbackPanel;

public class IndicatingButtonPage extends AbstractButtonPage // NOSONAR
{
	private static final long serialVersionUID = 1L;
	private static final Logger LOG = LoggerFactory.getLogger(IndicatingButtonPage.class);

	public IndicatingButtonPage()
	{
		final Form<Void> form = new Form<Void>("form") {

			private static final long serialVersionUID = 1L;

			@Override
			public void onSubmit()
			{
				try
				{
					Thread.sleep(2000);
				}
				catch (InterruptedException e)
				{
					if (LOG.isDebugEnabled())
					{
						LOG.debug(e.getMessage(), e);
					}
				}

				IndicatingButtonPage.this.info(this);
			}
		};

		this.add(form);

		// FeedbackPanel //
		final KendoFeedbackPanel feedback = new KendoFeedbackPanel("feedback");
		form.add(feedback.setOutputMarkupId(true));

		// Buttons //
		form.add(new IndicatingButton("button1") { // NOSONAR

			private static final long serialVersionUID = 1L;

			@Override
			public boolean isDisabledOnClick()
			{
				/*
				 * Warning: if true the button will not be send as part of the post because of its disabled state. Therefore Button#onSubmit() will not be reached, Form#onSubmit() should be used instead.
				 */
				return true;
			}
		});

		form.add(new IndicatingAjaxButton("button2") { // NOSONAR

			private static final long serialVersionUID = 1L;

			@Override
			public boolean isDisabledOnClick()
			{
				return true;
			}

			@Override
			protected void onSubmit(AjaxRequestTarget target)
			{
				target.add(feedback);
			}
		});
	}

	private final void info(Component component)
	{
		this.info(component.getMarkupId() + " has been submitted");
	}
}
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<head>
<wicket:head>
	<title>Wicket - Kendo UI: indicating ajax button</title>
</wicket:head>
</head>
<body>
<wicket:extend>
	<div id="demo-panel">
		<form wicket:id="form">
			<button wicket:id="button1">Indicating Button</button>
			<button wicket:id="button2">Indicating Ajax Button, with freeze</button>
			<br/><br/>
			<div wicket:id="feedback" style="width: 360px;"></div>
		</form>
	</div>
</wicket:extend>
</body>
</html>