22.4 Passing Parameter Values to Portlets

Portlets can accept values for their parameters from page parameters, system variables, or a constants passed from the page. This means that the information displayed within a portlet can be specific to a particular page or user. A portlet's parameters are specified in the file provider.xml.

You can pass values only to portlet parameters on Standard, Mobile, and Search pages, custom pages that are based on these page types, and navigation pages.

In Oracle Portal you can specify portlet parameter values for a particular page or for a Portal Template. When you specify portlet parameter values for a Portal Template for pages, the values are inherited by every page based on the Portal Template. Page designers can edit the template's parameter values when they edit the template but not when they edit the pages based on this template. When you specify parameters values for a Portal Template for items, they become the default values for items displayed on that template. For more information, see Section 12.1.1, "What Are Portal Templates?".

To pass values to portlet parameters:

  1. Go to the page (or template) that hosts the portlets to which you will pass parameter values.

  2. Switch to Edit mode.

  3. Click the Properties link next to Page (or Template) in the page toolbar.

    Be sure to click the link for the page (or template) rather than the page group.

  4. On the Properties page, click the Parameters tab to bring it forward.

    For page groups, parameters and events are enabled by default. If you cannot see the Parameters tab, the Enable Parameters and Events page group setting has been disabled. For more information, see Chapter 4, "Working with Page Groups".

  5. The Portlet Parameter Values section lists the portlets that are included on the page and indicates whether those portlets have any parameters.

    Click the name of a portlet to expand the portlet and display its parameters. If a portlet does not have any parameters defined, it cannot be expanded in the list.

    If you want to show the parameters for all the portlets on the page, click Expand All. However, if a portlet does not have any parameters, you cannot expand it in the list.

  6. For each portlet parameter:

    1. From the input parameter drop-down list, choose:

      Null if you do not want to provide a value for the portlet parameter.

      Page Parameter to pass the value of one of the page parameters to the portlet parameter.

      System Variable to pass the value of a system variable to the portlet parameter. For example, USER_NAME.

      Constant to pass a specific value to the portlet parameter.

    2. In the value field or list, choose the page parameter or system variable whose value you want to pass to the portlet, or enter a constant value.

  7. Click OK to save your changes and return to the page or template.

More on OTN
For information on adding parameters to a portlet, see the Oracle Fusion Middleware Developer's Guide for Oracle Portal available on the Oracle Portal documentation page of the Oracle Technology Network at http://www.oracle.com/technology/products/ias/portal/documentation.html.