Buy me a coffee :)

Wicket - jQuery UI

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

Feedback Console


Components / Samples

Description

The Kendo UI's console is not a Kendo standard widget, but is used in the Kendo UI's demo website.
For this reason, the style is not part of the Kendo UI's theme. It can however be customized using IConsoleLibrarySettings

Tip

In order to get only new feedback messages (ie: not keeping the history), #clear() should be called in #onConfigure and the console should be refreshed using target.add(console) (rather than console.refresh(target))
	final FeedbackConsole console = new FeedbackConsole("console") {
	
		private static final long serialVersionUID = 1L;
	
		@Override
		protected void onConfigure()
		{
			super.onConfigure();
	
			this.clear();
		}
	};
	
	...
	
	target.add(console);

Since

wicket-jquery-ui-kendo-6.12.0

Licensing

Kendo UI Console does not belongs to the Kendo UI Web framework.
A part of the underlying javascript is licensed under the MIT and GPL licenses.

Sources

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

import java.io.Serializable;

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.console.FeedbackConsole;
import com.googlecode.wicket.kendo.ui.form.TextField;
import com.googlecode.wicket.kendo.ui.form.button.AjaxButton;

public class FeedbackConsolePage extends AbstractConsolePage
{
	private static final long serialVersionUID = 1L;

	public FeedbackConsolePage()
	{
		// FeedbackConsole //
		final FeedbackConsole console = new FeedbackConsole("console") {

			private static final long serialVersionUID = 1L;

			@Override
			protected String format(Serializable message, boolean error)
			{
				if (error)
				{
					return String.format("<i>%s</i>", super.format(message, error));
				}

				return super.format(message, error);
			}
		};

		this.add(console);

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

		// TextField //
		final TextField<String> textField = new TextField<String>("message", Model.of(""));
		form.add(textField.setRequired(true));

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

			private static final long serialVersionUID = 1L;

			@Override
			protected void onSubmit(AjaxRequestTarget target)
			{
				this.info(textField.getModelObject());

				console.refresh(target);
			}

			@Override
			protected void onError(AjaxRequestTarget target)
			{
				console.refresh(target);
			}
		});
	}
}
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<head>
<wicket:head>
	<title>Wicket Kendo UI: feedback-console</title>
</wicket:head>
</head>
<body>
<wicket:extend>
	<div id="demo-panel">
		<form wicket:id="form">
			<input wicket:id="message" style="size: 200px;" />
			<button wicket:id="button">Add to log</button>
		</form>
		<br/>
		<div wicket:id="console" style="height: 100px;"></div>
	</div>
</wicket:extend>
</body>
</html>