Introduction to Navigation Components

18-4 Web User Interface Developers Guide for Oracle Application Development Framework

18.2.1 How to Use Command Buttons and Command Links

Typically, you use commandButton, commandLink, and commandImageLink components to perform page navigation and to execute any server-side processing. To create and use command components: 1. Create a commandButton component by dragging and dropping a Button from the Component Palette to the JSF page. Create a commandLink component by dragging and dropping a Link. Create a commandImageLink component by dragging and dropping an Image Link.

2. In the Property Inspector, expand the Common section and set the text attribute.

3. Set the icon attribute to the URI of the image file you want to use for inside a commandButton or commandImageLink component this is not supported for commandLink. For a commandImageLink component, you can also set the hoverIcon, disabledIcon, and depressedIcon attributes. 4. Set the action attribute to an outcome string or to a method expression that refers to a backing bean action method that returns a logical outcome String. For more information about configuring the navigation between pages, see Section 2.3, Defining Page Flows . The default JSF ActionListener mechanism uses the outcome string to select the appropriate JSF navigation rule, and tells the JSF NavigationHandler what page to use for the Render Response phase. For more information about using managed bean methods to open dialogs, see Chapter 13, Using Popup Dialogs, Menus, and Windows . For more information about outcome strings and navigation in JSF applications, see the Java EE 6 tutorial at http:download.oracle.comjavaeeindex.html . Note: A warning message may also appear for uncommitted data if you set the document tag’s uncommittedDataWarning tag to on and your page renders an ADF Controller bounded task flow that is configured as critical, as described in the How to Enable Implicit Save Points section of the Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework. Tip: Alternatively, you can use the textAndAccessKey attribute to provide a single value that defines the label along with the access key to use for the button or link. For information about how to define access keys, see Section 22.3.4, How to Define Access Keys for an ADF Faces Component Tip: You can use either the text attribute or textAndAccessKey attribute or the icon attribute, or both. Working with Navigation Components 18-5

5. Expand the Behavior section and set the disabled attribute to true if you want

to show the component as a non-interactive button or link. 6. Set the partialSubmit attribute to true to fire a partial page request each time the component is activated. For more information, see Section 7.2, Enabling Partial Page Rendering Declaratively . 7. Set the immediate attribute to true if you want skip the Process Validations and Update Model phases. The component’s action listeners if any, and the default JSF ActionListener handler are executed at the end of the Apply Request Values phase of the JSF lifecycle. For more information, see Section 4.2, Using the Immediate Attribute . 8. Optionally, if you set the immediate attribute to true as described in step 7, you can add the af:checkUncommittedDataBehavior component as a child to the command component to display a warning message to the user if the page contains uncommitted data. Drag the Check Uncommitted Data Behavior from the Behavior section of the Operations panel in the Component Palette and drop it as a child of the command component you added in step 1. Command buttons and links can also be used to open secondary windows through these attributes: useWindow, windowHeight, windowWidth, launchListener, and returnListener. For information about opening secondary windows, see Chapter 18, Working with Navigation Components .

18.2.2 How to Use Go Buttons and Go Links

You use the goButton, goImageLink, and goLink components to perform direct page navigation, without delivering an ActionEvent event. To create and use go buttons and go links: 1. Create a goButton component by dragging and dropping a Go Button from the Component Palette to the JSF page. Create a goLink component by dragging and dropping a Go Link. Create a goImageLink component by dragging and dropping a Go Image Link. Tip: The actionListener attribute can also be used for navigation when bound to a handler that returns an outcome. Usually, you should use this attribute only to handle user interface logic and not navigation. For example, in the File Explorer application, the Search button in Search panel does not navigate anywhere. Instead, it is used to perform a search. It has the following value for its actionListener attribute: actionListener={explorer.navigatorManager.searchNavigator. searchForFileItem} This expression evaluates to a method that actually performs the search. Note: You must have also set the document tag’s uncommittedDataWarning attribute to on, as described in Section 8.2.5, How to Configure the document Tag.