Example usage for org.apache.wicket.markup.html WebMarkupContainer getRequestCycle

List of usage examples for org.apache.wicket.markup.html WebMarkupContainer getRequestCycle

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html WebMarkupContainer getRequestCycle.

Prototype

public final RequestCycle getRequestCycle() 

Source Link

Document

Gets the active request cycle for this component

Usage

From source file:org.projectforge.web.doc.DocumentationPage.java

License:Open Source License

/**
 * Adds BookmarkablePageLink with given id to the given parentContainer.
 * @param id id of the link (shouldn't bee "newsLink" in body, because it's already used by DocumentationPage).
 * @param parentContainer Page (normally body)
 *//*from w  w w. j ava  2s.co  m*/
public static final AbstractLink addNewsLink(final WebMarkupContainer parentContainer, final String id) {
    final AbstractLink link = new ExternalLink(id,
            WicketUtils.getUrl(parentContainer.getRequestCycle(), "secure/doc/News.html", true));
    parentContainer.add(link);
    return link;
}

From source file:org.projectforge.web.doc.DocumentationPage.java

License:Open Source License

private static void addDocLink(final WebMarkupContainer parentContainer, final String id, final String url) {
    final WebMarkupContainer linkContainer = new WebMarkupContainer(id);
    linkContainer.add(AttributeModifier.replace("onclick", "javascript:openDoc('"
            + WicketUtils.getUrl(parentContainer.getRequestCycle(), "secure/" + url, true) + "');"));
    linkContainer.add(AttributeModifier.replace("onmouseover", "style.cursor='pointer'"));
    parentContainer.add(linkContainer);// w w w .  j av  a  2 s  . co  m
}