Adding navigation components to a Faces JSP page
Before you begin
About this task
With navigation components based on logical actions, the navigation component passes a command to the server where the action is sent to an action handler. After manipulation by the handler, the action is then evaluated against a set of navigation rules to determine which page is displayed next in the browser. HTML URIs are not hard-coded into a page, instead, logical actions are coded and the navigation logic is encoded in the navigation rules. Essentially the navigation structure is externalized into a separate model.
With navigation components based on dynamically constructing the link, the navigation component wrappers HTML link functionality, providing the ability to dynamically construct the link when it is emitted by the page.
Individual navigation components can be organized into more complex structures such as action bars (usually displayed as a row or column of buttons or links) or menu bars (an complex tree of menus of navigation components). A data table (or individual columns in a data table) can also be structured to contain navigation components.
The method by which page components are added to a page varies based on the component:
| Navigation component1 | Tag | Description | How is component added to a page? |
|---|---|---|---|
| Button - Command | <hx:commandExButton> | Creates a push button that may have text and/or an image in it. If the button is of type submit, clicking the button submits the form and passes a command (action) to the server. The button may run an action. See Adding navigation rules to Faces JSP components for information on actions and navigations rules. | Drag Button - Command from the palette onto the page. |
| Command row action | <hx:commandExRowAction> | Assigns a command (action) to a row of a data table. Clicking the row submits the page and passes a command (action) to the server along with the identity of the row that was clicked. |
Note: This component is only available on the Enhanced Faces
Components drawer of the palette.
|
| Link - Command Remember: This tag is initially hidden
on the Palette. To display this tag on the Palette right-click the
Palette and deselect Hide for this tag.
|
<h:commandLink> | Creates a hyperlink. Clicking the link submits the form and passes a command (action) to the server. The command determines the next page to display. See Adding hyperlinks to a JSF page and Adding navigation rules to Faces JSP components for information on hyperlinks, actions, and navigations rules. | Drag Link - Command from the palette onto the page. |
| Link | <hx:outputLinkEx> | Displays a hyperlink that goes to a specified URL. | Drag Link from the palette onto the page. |
| Panels - Menu bar | <hx:panelActionbar> | Inserts a panel that places commands into a menu bar. You can drag and drop buttons, hyperlinks, and horizontal rules to the panel or add them from within the Properties views of the components. You can also add a sub-menu bar within a menu bar. | Drag Panels - Menu bar from the palette onto the page. |
| Menu bar | <hx:panelMenu> | Displays a (hierarchical) menu bar of buttons and/or hyperlinks. | Drag Menu bar from the palette onto the page. |
| Link - Request | <hx:requestLink> | Displays a hyperlink. Clicking the link passes a command (action) to the server through the URL. The command determines the next page to display. | Drag Link - Request from the palette onto the page. |
| Request row action | <hx:requestRowAction> | Assigns a command (action) to a row of a data table. Clicking the row passes a command (action) to the server through the URL. The command/row clicked determines the next page to display. |
|
Once you have added a navigation component to your Faces JSP page, configure the properties for the component. To open the Properties view, click . For a description of the navigation component properties, refer to the specific navigation component listed.