Buy me a coffee :)

Wicket - jQuery UI

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

ButtonGroup

  • false
  • true



Components / Samples

Description

Since

wicket-kendo-ui-7.1.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 java.util.Arrays;
import java.util.List;

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

import com.googlecode.wicket.kendo.ui.form.button.AjaxButton;
import com.googlecode.wicket.kendo.ui.form.button.Button;
import com.googlecode.wicket.kendo.ui.form.buttongroup.ButtonGroup;
import com.googlecode.wicket.kendo.ui.panel.KendoFeedbackPanel;

public class ButtonGroupPage extends AbstractButtonPage
{
	private static final long serialVersionUID = 1L;
	private static final List<Boolean> CHOICES = Arrays.asList(Boolean.FALSE, Boolean.TRUE);

	public ButtonGroupPage()
	{
		final Form<Boolean> form = new Form<Boolean>("form", Model.of(Boolean.TRUE));
		this.add(form);

		// FeedbackPanel //
		form.add(new KendoFeedbackPanel("feedback"));

		// ButtonGroup //
		form.add(new ButtonGroup<Boolean>("button-group", form.getModel(), Model.ofList(CHOICES)));

		// Buttons //
		form.add(new Button("submit") {

			private static final long serialVersionUID = 1L;

			@Override
			public void onSubmit()
			{
				ButtonGroupPage.this.info(form);
			}
		});

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

			private static final long serialVersionUID = 1L;

			@Override
			protected void onSubmit(AjaxRequestTarget target)
			{
				ButtonGroupPage.this.info(form);
				target.add(form);
			}
		});
	}

	private final void info(Component component)
	{
		this.info(String.format("Submitted value: %s", component.getDefaultModelObjectAsString()));
	}
}
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<head>
<wicket:head>
	<title>Wicket - Kendo UI: button group</title>
</wicket:head>
</head>
<body>
<wicket:extend>
	<div id="demo-panel">
		<form wicket:id="form">
			<span wicket:id="button-group">[button group]</span>
			<br/>
			<button wicket:id="submit" type="submit">Submit</button>
			<button wicket:id="button">Ajax Submit</button>
			<br/><br/>
			<div wicket:id="feedback" style="width: 360px;"></div>
		</form>
	</div>
</wicket:extend>
</body>
</html>