|
|
|
Description
Creates a HTML <a> hyperlink to another page within the application.
The Page component uses the
PageService to construct the anchor's "href" URL.
Prior to release 2.2, this component was named Page.
|
See Also
ActionLink,
DirectLink,
ExternalLink,
GenericLink,
Rollover,
ServiceLink
|
Parameters
Name |
Type |
Direction |
Required |
Default |
Description |
page |
String |
in |
yes |
|
The name of a application page to link to. |
disabled |
boolean |
in |
no |
false |
Controls whether the link is produced. If disabled, the portion of the
template the link surrounds is still rendered, but not the link itself.
|
namespace |
INamespace
|
in |
no |
|
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).
|
scheme |
String |
in |
no |
|
If specified, then a longer URL (including scheme, server and possibly port)
is generated using the specified scheme. Server is determined fromt he
incoming request, and port is deterimined from the port paramter or the
incoming request.
|
port |
int |
in |
no |
|
If specified, then a longer URL (including scheme, server and port) is
generated using the specified port. The server is determined from the
incoming request, the scheme from the scheme paramter or the incoming
request.
|
anchor |
String |
in |
no |
|
The name of an anchor or element to link to. The final URL will have '#'
and the anchor appended to it.
|
Body: rendered
Informal parameters: allowed
Reserved parameters: "href"
|
Examples
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.
Typically you would create an navigation menu component, using the
RenderBody component. This navigation menu
component would then be included as the first element in all the application's
pages.
<!-- Navigation Bar -->
<table bgcolor="navy" cellpadding="8" cellspacing="6" width="100%">
<tr>
<span jwcid="foreachNavigationPage">
<td><font color="white"><b><span jwcid="navigationPageLink"/></b></font></td>
</span>
</tr>
</table>
<component id="foreachNavigationPage" type="Foreach">
<binding name="source" expression="engine@NAVIGATION_PAGES"/>
<binding name="value" expression="navigationPage"/>
</component>
<component id="navigationPageLink" type="PageLink">
<binding name="page" expression="navigationPage"/>
<binding name="disabled" expression="! visit.authenticated"/>
</component>
public class MailPage extends BasePage {
private String navigationPage;
public String getNavigationPage() { return navigationPage; }
public void setNavigationPage(String value) {
navigationPage = value;
}
public void detach() {
navigationPage = null;
super.detach();
}
}
public class Visit implements Serializable {
private boolean authenticated;
public boolean isAuthenticated() { return authenticated; }
public void setAuthenticated(boolean value) {
authenticated = value;
}
}
public class MailEngine extends SimpleEngine implements Serializable {
public static final String[] NAVIGATION_PAGES =
{ "Home", "Inbox", "Sent", "Compose", "Contacts", "Options", "Help", "Logout" };
}
|
|