Buy me a coffee :)

Wicket - jQuery UI

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

Auto-complete: custom beans

Select a metal genre: (containing any char)

Components / Samples





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
To be able to use it, you need to change the ResourceReference with kendo.all.min.js

See also



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

import java.util.List;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.image.ContextImage;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;

import com.googlecode.wicket.jquery.core.resource.StyleSheetPackageHeaderItem;
import com.googlecode.wicket.jquery.core.utils.ListUtils;
import com.googlecode.wicket.kendo.ui.form.autocomplete.AutoCompleteTextField;
import com.googlecode.wicket.kendo.ui.form.button.AjaxButton;
import com.googlecode.wicket.kendo.ui.panel.KendoFeedbackPanel;

public class KendoCustomAutoCompletePage extends AbstractAutoCompletePage
	private static final long serialVersionUID = 1L;

	public KendoCustomAutoCompletePage()
		// Model //
		final IModel<Genre> model = Model.of(GenresDAO.newGenre());

		// Form //
		final Form<Void> form = new Form<Void>("form");

		// FeedbackPanel //
		final KendoFeedbackPanel feedback = new KendoFeedbackPanel("feedback");

		// Container for selected genre (name & cover) //
		final WebMarkupContainer container = new WebMarkupContainer("container");

		container.add(new ContextImage("cover", new PropertyModel<String>(model, "cover")));
		container.add(new Label("name", new PropertyModel<String>(model, "name")));

		// Auto-complete //
		final AutoCompleteTextField<Genre> autocomplete = new AutoCompleteTextField<Genre>("autocomplete", model) {

			private static final long serialVersionUID = 1L;

			protected List<Genre> getChoices(String input)
				return ListUtils.contains(input, GenresDAO.all());

			protected void onSelected(AjaxRequestTarget target)
				target.add(container); // the model has already been updated


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

			private static final long serialVersionUID = 1L;

			protected void onSubmit(AjaxRequestTarget target)

	// Methods //

	public void renderHead(IHeaderResponse response)

		response.render(new StyleSheetPackageHeaderItem(KendoCustomAutoCompletePage.class));

	private void info(AutoCompleteTextField<?> autocomplete)
		Object choice = autocomplete.getModelObject(); != null ? choice.toString() : "no choice");
<!DOCTYPE html>
<html xmlns:wicket="">
	<title>Wicket Kendo UI: auto-complete (custom bean)</title>
	<div id="demo-panel">
		<form wicket:id="form">
					<td style="width: 300px; vertical-align: top;">
						<div>Select a metal genre: (containing any char)</div>
						<input wicket:id="autocomplete" type="text" size="30" />
						<button wicket:id="button" type="submit">Submit</button>
						<div wicket:id="feedback" style="width: 360px;"></div>
					<td wicket:id="container" style="width: 100px;">
						<img wicket:id="cover" class="k-block" />
						<div wicket:id="name" style="text-align: center;"></div>
table {
	width: 400px;
	border-spacing: 0;
	border-collapse: collapse;

th, td {
	padding: 5px;