Wicket JavaScript and jQuery

Wicket JS is a library that helps you to write and handle JavaScript and jQuery within Wicket

Лицензия

Лицензия

Категории

Категории

JavaScript Языки программирования Wicket Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

org.rauschig
Идентификатор

Идентификатор

wicket-js
Последняя версия

Последняя версия

0.4.0
Дата

Дата

Тип

Тип

bundle
Описание

Описание

Wicket JavaScript and jQuery
Wicket JS is a library that helps you to write and handle JavaScript and jQuery within Wicket
Ссылка на сайт

Ссылка на сайт

http://rauschig.org/wicket-js
Система контроля версий

Система контроля версий

https://github.com/thrau/wicket-js

Скачать wicket-js

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.apache.wicket : wicket-core jar 6.0.0
com.fasterxml.jackson.core : jackson-databind jar 2.2.0

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11
org.mockito : mockito-all jar 1.9.5

Модули Проекта

Данный проект не имеет модулей.

Wicket JavaScript and jQuery

Build Status   Coverage Status

wicket-js makes it easy to write and handle custom JavaScript and jQuery from within Wicket Components and Behaviors. It helps to separate Wicket Ajax Behavior listeners from actual client-side UI functionality, while maintaining the coupling towards Wicket Components.

It provides a (rudimentary) fluent interface that allows you to build JavaScript and jQuery expressions in Java.

Example

With wicket-js you can bind arbitrary JavaScript code to Wicket Components in a clean way. It provides basic syntax elements for typesafe script creation.

component.add(new JsBehavior() {
    @Override
    protected IJavaScript domReadyJs() {
        return new JsCall("alert", "loaded component with markup-id " + id());
    }
});

The API also provides a convenient way of writing jQuery expressions and bind client-side jQuery event behavior to components. This allows for separation of the Wicket AJAX listening mechanisms and the true client-side JavaScript functionality while keeping the JavaScript in the actuall Component definitions.

component.add(new JQueryEventBehavior("mouseenter mouseleave") {
    @Override
    protected IJavaScript callback() {
        return new JsStatements(
                $(this).toggleClass("entered"),
                $(this).trigger("toggled")
        );
    }
});

With jQuery's trigger and Wickets AjaxEventBehavior you can wire client-side JavaScript behavior with Wicket AJAX event handling in a clean way while keeping them separate.

component.add(new AjaxEventBehavior("toggled") {
    @Override
    protected void onEvent(AjaxRequestTarget target) {
        System.out.println("selection has changed!");
    }
});

Dependencies

  • wicket-core 6.11.0
  • jackson-databind [2.0,)

Notice

wicket-js is in alpha phase and subject to rapid development and change

Версии библиотеки

Версия
0.4.0
0.3.0
0.2.0
0.1.0