Buy me a coffee :)

Wicket - jQuery UI

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

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

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 org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.feedback.ErrorLevelFeedbackMessageFilter;
import org.apache.wicket.feedback.FeedbackMessage;
import org.apache.wicket.feedback.FeedbackMessagesModel;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.Model;

import com.googlecode.wicket.kendo.ui.console.Console;
import com.googlecode.wicket.kendo.ui.form.TextField;
import com.googlecode.wicket.kendo.ui.form.button.AjaxButton;

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

	private final FeedbackMessagesModel errorFeedbackMessagesModel;

	public DefaultConsolePage()
	{
		this.errorFeedbackMessagesModel = newErrorFeedbackMessagesModel(this);

		this.initialize();
	}

	private void initialize()
	{
		// Console //
		final Console console = new Console("console");
		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)
			{
				console.info(target, textField.getModelObject());
			}

			@Override
			protected void onError(AjaxRequestTarget target)
			{
				for (FeedbackMessage message : errorFeedbackMessagesModel.getObject())
				{
					console.error(target, message.getMessage());
					message.markRendered();
				}
			}
		});
	}

	protected static FeedbackMessagesModel newErrorFeedbackMessagesModel(Page page)
	{
		return new FeedbackMessagesModel(page, new ErrorLevelFeedbackMessageFilter(FeedbackMessage.ERROR));
	}
}
<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org">
<head>
<wicket:head>
	<title>Wicket Kendo UI: 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>