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 jwcid="@Foreach" source="ognl:engine@NAVIGATION_PAGES" value="ognl:navigationPage" element="tr">
<td><font color="white"><b><span jwcid="@PageLink" page="ognl:navigationPage" disabled="ognl:! visit.authenticated"/></b></font></td>
</tr>
</table>
<property-specification name="navigationPage" type="java.lang.String"/>
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 SimpleEngine implements Serializable {
public static final String[] NAVIGATION_PAGES =
{ "Home", "Inbox", "Sent", "Compose", "Contacts", "Options", "Help", "Logout" };
}
|