Passing parameters
From a data table, you can pass a parameter from one Faces JSP page to another. Several Faces components, such as command buttons or command hyperlinks, can help you do this
To do this, you can use a data table row action.
For example, you can return a detailed page of data for a record that your user selects in a data table. To do this, you might fuse a data table row action to pass a parameter from the data table page to the details page. (Note that you can also pass parameters by using a Command - Hyperlink component bound to a column of the data table.)
- Add a row action control to your data table. On the Row actions tab of the Properties view of the data table, click Add next to "Add an action that's performed when a row is clicked." A new column containing a row action control is added to the data table. The row action control is selected.
- In the Properties view for the row action control (commandExRowAction), you can switch to the Quick Edit view to code an action for the row actions (and you can also identify the pages that the actions can go to by using navigation rules.) To write a custom action for the row action.
- Open the Quick Edit view for the row action by clicking the Quick Edit view button in the Properties view.
- Click the right-hand pane of the Quick Edit view.
- Enter code to define your new action.
- To set up navigation rules (identifying the pages the actions can go to), see Using navigation rules with Faces JSP pages.
- Add a parameter for the row action.
- Select the Parameter tab for the Row Action.
- Click Add Parameter.
- Click within the Name field and enter a name for your new parameter. It can correspond to a column of your data table, for example ID.
- You can give your parameter a value or bind it to a field in your data object. To bind to a data field, click within the Value field for your new parameter.
- Click the button that displays in the Value field. The Select Page Data Object dialog opens.
- Select the relational record to bind to your parameter. For example, you can select the ID field in the same relational record list that your data table is bound to.
After you create the row action, you can run your page on the test server by right-clicking the page in the Project Explorer view and selecting Run > Run on Server.
Related concepts
Data table components
Related tasks
Adding a data table
Enabling data table row selection
Associating actions with a data table
Using navigation rules with Faces JSP pages
Passing parameters between JSP files
Adding scripted events to Web pages
Related reference
Faces components reference
Faces attributes reference