Example usage for org.apache.wicket.core.request.handler EmptyAjaxRequestHandler getInstance

List of usage examples for org.apache.wicket.core.request.handler EmptyAjaxRequestHandler getInstance

Introduction

In this page you can find the example usage for org.apache.wicket.core.request.handler EmptyAjaxRequestHandler getInstance.

Prototype

public static EmptyAjaxRequestHandler getInstance() 

Source Link

Document

Gets the singleton instance.

Usage

From source file:org.hippoecm.frontend.plugins.yui.flash.ProbeFlashBehavior.java

License:Apache License

@Override
protected void respond(AjaxRequestTarget target) {
    Request request = RequestCycle.get().getRequest();

    FlashVersion flash = new FlashVersion();
    try {// w w  w .j ava2 s.c o  m
        flash.setMajorVersion(request.getRequestParameters().getParameterValue("major").toInt());
        flash.setMinorVersion(request.getRequestParameters().getParameterValue("minor").toInt());
        flash.setRevisionVersion(request.getRequestParameters().getParameterValue("rev").toInt());
    } catch (NumberFormatException ignored) {
    }
    handleFlash(flash);

    //Responding with a regular AJAX-response can cause feedback info to disappear immediately
    //after page-load. This is resolved forcing an empty response for this behavior
    RequestCycle.get().scheduleRequestHandlerAfterCurrent(EmptyAjaxRequestHandler.getInstance());
}