Adding hyperlinks to a Faces JSP file

You can use the Link component and the Link - Command component to add site jumps and page jumps to your Web project.

Generally, you use the Link component to link to Web pages that are outside the Web project and the Link - Command component to link to internal pages. The Link - Command component is also useful for enabling additional actions when a link is activated. The hyperlink can perform updates and then identify the next page within a Web project to navigate to. For example, you can use the Link - Command component for actions that apply to a single row in a relational record list. To add a Link - Command component to a Faces JSP page

  1. Drag a Link - Command component from the palette to the page or to an Output or Image component already on the page.

    Note: If you drop the Link or the Link - Command component onto a blank area of the Faces JSP page, an Output component is automatically added within the Link or Link - Command component. The Output text contains the label for the link.

  2. To change the label, select the Output Text component. In the Properties view for the Output Text component, enter a new label in the

    Value field. This is the link text that displays at run time.

  3. Make sure the link icon is selected and then use the Quick Edit view to create an action for the link as the Command event. (See Adding scripted events to Web pages.)

  4. Then add navigation by clicking

    Add Rule on the Properties view of the Link - Command component. The "Add Navigation Rule" dialog opens. With Navigation Rules, you can direct the user to certain pages depending on what has just occurred (for example, an error). You define the action you want to perform in the Quick Edit View. The navigation rules determines which page to go to based on the return value from the action (for example, it might go to one page if the return value is success and not failure.). A navigation rule can be specific to a given action, or apply to any action. You can also have the rule apply only to the given page, or to all pages in the project.

  5. Set additional Link - Command properties. For example, you can add any parameters on the

    Parameters tab of the Link - Command Properties view. These parameters are then passed to the action.