doc/src/ComponentReference/PageLink.html (210 lines of code) (raw):

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- $Id$ --> <html> <head> <title>PageLink</title> <link rel="stylesheet" type="text/css" href="Tapestry.css" title="style"> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left"><A href="Option.html"><IMG alt=Option src="common-images/prev.png"></A></td> <td align="middle"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></A></td> <td align="right"><A href="PropertySelection.html"><IMG alt=PropertySelection src="common-images/next.png"></A></td> <tr> <tr> <td colspan="3"><hr></td> </tr> <tr> <td colspan="3"> <table border="0" cellpadding="4" cellspacing="4" width="100%"> <tr valign="top"> <td> <table> <tr> <td><font size="+2"><b>PageLink</b></font></td> </tr> <tr> <td> <A href="../api/org/apache/tapestry/link/PageLink.html"> org.apache.tapestry.link.PageLink</A> </td> </tr> </table> </td> <td> <table align="right" valign="middle" bgcolor="#c0c0c0" cellpadding="8"> <tr> <td><A href="PageLink.html"><font color="blue">Page Link</font></A></td> </tr> </table> </td> </tr> <tr valign="center"> <td colspan="2">&nbsp;</td> </tr> <tr> <td colspan="2"> <p> <b>Description</b> <br> Creates a HTML &lt;a&gt; hyperlink to another page within the application. The Page component uses the <A href="../api/org/apache/tapestry/engine/PageService.html"> <tt>PageService</tt></A> to construct the anchor's "href" URL. </p> <p>Prior to release 2.2, this component was named <STRONG>Page</STRONG>.</P> </td> </tr> <tr> <td colspan="2"> <b>See Also</b> <br> <A href="ActionLink.html">ActionLink</a>, <A href="DirectLink.html">DirectLink</A>, <A href="ExternalLink.html">ExternalLink</a>, <A href="GenericLink.html">GenericLink</A>, <A href="Rollover.html">Rollover</A>, <A href="ServiceLink.html">ServiceLink</a> </td> </tr> <tr> <td colspan="2"> <b>Parameters</b> <br> <table border="1" cellpadding="4" cellspacing="4" class="parameters"> <tr> <th>Name</th> <th>Type</th> <th>Direction</th> <th>Required</th> <th>Default</th> <th>Description</th> </tr> <tr> <td>page</td> <td>String</td> <td>in</td> <td>yes</td> <td>&nbsp;</td> <td>The name of a application page to link to.</td> </tr> <tr> <td>disabled</td> <td>boolean</td> <td>in</td> <td>no</td> <td>false</td> <td> Controls whether the link is produced. If disabled, the portion of the template the link surrounds is still rendered, but not the link itself. </td> </tr> <tr> <td>namespace</td> <td><A href="../api/org/apache/tapestry/INamespace.html"> <tt>INamespace</tt></A> </td> <td>in</td> <td>no</td> <td>&nbsp;</td> <td> If specified, the namespace's prefix is prefixed (with a colon) to the page name. This is primarily used when pages (or components) in a namespace need to create links to other pages inside the same namespace (this is only a concern for developers of component libraries, not developers of applications). </td> </tr> <tr> <td>anchor</td> <td>String</td> <td>in</td> <td>no</td> <td>&nbsp;</td> <td> The name of an anchor or element to link to. The final URL will have '#' and the anchor appended to it. </td> </tr> <tr> <td>renderer</td> <td><a href="../api/org/apache/tapestry/link/ILinkRenderer.html">ILinkRenderer</a></td> <td>in</td> <td>no</td> <td>&nbsp;</td> <td> The object which will actually render the link. </td> </tr> </table><BR> Body: <STRONG>rendered</STRONG><BR> Informal parameters: <STRONG>allowed</STRONG><br> Reserved parameters: "href" </td> </tr> <tr> <td colspan="2"> <b>Examples</b> <p> This example uses the PageLink component to create a navigation menu bar across the top of the page. If the user is not authenticated, in their Visit object, all the navigation bar links are disabled. </p> <p> Typically you would create an navigation menu component, using the <a href="RenderBody.html">RenderBody</a> component. This navigation menu component would then be included as the first element in all the application's pages. </p> <table bgcolor="navy" cellpadding="8" cellspacing="6" width="100%"> <tr> <td><font color="white"><b><a href="PageLink.html">Home</a></b></font></td> <td><font color="white"><b><a href="PageLink.html">Inbox</a></b></font></td> <td><font color="white"><b><a href="PageLink.html">Sent</a></b></font></td> <td><font color="white"><b><a href="PageLink.html">Compose</a></b></font></td> <td><font color="white"><b><a href="PageLink.html">Contacts</a></b></font></td> <td><font color="white"><b><a href="PageLink.html">Options</a></b></font></td> <td><font color="white"><b><a href="PageLink.html">Help</a></b></font></td> <td><font color="white"><b><a href="PageLink.html">Logout</a></b></font></td> </tr> </table> <table class="tapestry-examples" cellpadding="6" width="100%"> <tr> <td>My mail page content.</td> </tr> </table> <pre> &lt;!-- Navigation Bar --&gt; &lt;table bgcolor="navy" cellpadding="8" cellspacing="6" width="100%"&gt; &lt;tr jwcid="@<a href="Foreach.html">Foreach</a>" source="ognl:engine@NAVIGATION_PAGES" value="ognl:navigationPage" element=&quot;tr&quot;&gt; &lt;td&gt;&lt;font color="white"&gt;&lt;b&gt;&lt;span jwcid="<span class="jwcid">@<a href="PageLink.html">PageLink</a></span>" page="ognl:navigationPage" disabled="ognl:! visit.authenticated"/&gt;&lt;/b&gt;&lt;/font&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;property-specification name=&quot;navigationPage&quot; type=&quot;java.lang.String&quot;/&gt;<br> public abstract class MailPage extends BasePage { public abstract String getNavigationPage(); } public class Visit implements Serializable { private boolean authenticated; public boolean isAuthenticated() { return authenticated; } public void setAuthenticated(boolean value) { authenticated = value; } } public class MailEngine extends <a href="../api/org/apache/tapestry/engine/SimpleEngine">SimpleEngine</a> implements Serializable { public static final String[] NAVIGATION_PAGES = { "Home", "Inbox", "Sent", "Compose", "Contacts", "Options", "Help", "Logout" }; } </pre> </td></tr></table> </td></tr> <tr> <td colspan="3"><hr></td> </tr> <tr> <td align="left"><A href="Option.html"><IMG alt=Option src="common-images/prev.png"></A></td> <td align="middle"><A href="index.html"><IMG alt="Component Index" src="common-images/home.png" ></A></td> <td align="right"><A href="PropertySelection.html"><IMG alt=PropertySelection src="common-images/next.png"></A></td> </tr> </table> </body> </html>