Example usage for org.apache.wicket.markup.html.panel Panel render

List of usage examples for org.apache.wicket.markup.html.panel Panel render

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.panel Panel render.

Prototype

public final void render() 

Source Link

Document

Render this component and all its children.

Usage

From source file:org.apache.openmeetings.service.mail.template.AbstractTemplatePanel.java

License:Apache License

/**
 * Collects the html generated by the rendering of a page.
 * // w w  w . j a va  2 s  .  c  om
 * @param panel
 *            the panel that should be rendered.
 * @return the html rendered by the panel
 */
protected static CharSequence renderPanel(final Panel panel) {
    RequestCycle requestCycle = RequestCycle.get();

    final Response oldResponse = requestCycle.getResponse();
    BufferedWebResponse tempResponse = new BufferedWebResponse(null);

    try {
        requestCycle.setResponse(tempResponse);

        TemplatePage page = new TemplatePage();
        page.add(panel);

        panel.render();
    } finally {
        requestCycle.setResponse(oldResponse);
    }

    return tempResponse.getText();
}