Wicket Integration

Table of Contents

Wicket Integration

Wicket integration comes in the form of a Panel. Extending org.icepush.integration.wicket.core.PushPanel automatically creates a group with the same name as the Panel id, allows you to make push call(s) when necessary, and update your model and GUI by implementing the pushCallback() method.

Enable Wicket Application for Push

  1. Add icepush.jar and icepush-wicket.jar to your application.
  2. In the web.xml of your application, add the following:
    web.xml ICEpush Excerpt
  3. Nest the following in the head tag of your page:
    Script added to head tag
        <script type="text/javascript" src="code.icepush"></script>

    Implement Push in Wicket Application

  1. Create a Wicket Panel by extending org.icepush.integration.wicket.core.PushPanel.
  2. Add push JavaScript to your panel's html file:
    Adding push javascript to yourpanel.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    <html xmlns:wicket>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
                <script wicket:id="pushJavascript" type="text/javascript">
                <!-- INSERT CONTENTS OF YOUR PANEL HERE -->
    Do not nest this script in a component that is updated via AJAX. This will result in the script being executed multiple times.
  3. Add push call(s), as necessary, to your Java class:
    Example push call in yourpanel.java
    leftForm.add(new AjaxButton("leftButton") {
            protected void onSubmit(AjaxRequestTarget target, Form form) {
                // PUSH CALL
  4. Implement the pushCallback(AjaxRequestTarget target) method in your panel's Java class to update your model and render the appropriate components on callback.
    Example pushCallback in yourpanel.java
    protected void pushCallback(AjaxRequestTarget target) {
                pushList.add("My Push.");
                pushList.add("Pushed From Another User.");
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

© Copyright 2017 ICEsoft Technologies Canada Corp.