Thursday, 6 September 2012

Create Hyperlinks to URLs or Other Visualforce Pages


You might want to point from one Visualforce page to another, or to an external URL.
  1. Modify your Visualforce page to include the <apex:outputlink> component to produce a link:
    <apex:outputLink value="http://developer.force.com/">Click me!</apex:outputLink>
  2. To reference a page, use the expression {! $Page.pagename} to determine its URL.
  3. You can then include a link as follows:
    <apex:outputLink value="{! $Page.AccountDisplay}">I am me!</apex:outputLink>
You can think of $Page as a global object that has a field for every page you’ve created.

No comments:

Post a Comment