Example usage for org.apache.wicket Page getPageReference

List of usage examples for org.apache.wicket Page getPageReference

Introduction

In this page you can find the example usage for org.apache.wicket Page getPageReference.

Prototype

public PageReference getPageReference() 

Source Link

Document

Gets page instance's unique identifier

Usage

From source file:org.efaps.esjp.ui.print.UserInterface_Base.java

License:Apache License

/**
 * Get the html for the columns field.//from   ww w .  ja  v  a 2s  . com
 *
 * @param _parameter Parameter as passed form the eFaps API
 * @return html snipplet
 * @throws EFapsException on error
 */
public Return getColumnsFieldValueUI(final Parameter _parameter) throws EFapsException {
    final Return ret = new Return();
    final StringBuilder html = new StringBuilder();
    html.append("<span id=\"eFapsColumns4Report\">");

    final IRequestHandler handler = RequestCycle.get().getRequestHandlerScheduledAfterCurrent();
    if (handler instanceof AjaxRequestHandler) {
        final Page page = ((AjaxRequestHandler) handler).getPage();
        final PageReference reference = page.getPageReference();
        Context.getThreadContext().setSessionAttribute(UserInterface_Base.UIOBJECT_CACHEKEY, reference);
        final AbstractUIPageObject uiObject = (AbstractUIPageObject) page.getDefaultModelObject();
        html.append(updateColumns(uiObject));
    }
    html.append("</span>");
    ret.put(ReturnValues.SNIPLETT, html.toString());
    return ret;
}