Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: fixed language param of code macro

...

However, you can accomplish the same thing with a little code and markup. For example, to create a link to another page and pass a query parameter, you can replace your PageLink component with a standard <a> tag:

Code Block
controlstrue
linenumberslanguagetruexml

<a href="${profilePageLink}">Display Profile (w/ full details)</a>

In the matching Java class, you can create the Link programmatically:

Code Block
controlstrue
linenumberslanguagetruejava

  @Inject
  private PageRenderLinkSource linkSource;

  public Link getProfilePageLink()
  {
    Link link = linkSource.createPageRenderLinkWithContext(DisplayProfile.class, user);

    link.addParameterValue("detail", true);

    return link;
  }

... and in the DisplayProfile page:

Code Block
controlstrue
linenumberslanguagetruejava

public class DisplayProfile
{
  void onActivate(@RequestParameter("detail") boolean detail)
  {
    . . .
  }
}

...

Sometimes it is useful to create a link back to the current page, but you don't always know the name of the page (the link may appear inside a deeply nested subcomponent). Fortunately, this is easy.

Code Block
languagexml

<t:pagelink page="prop:componentResources.pageName">refresh page</t:pagelink>

...