Adding and updating Faces portlet modes

To add Faces portlet modes and their initial pages, or change an initial page value, edit configuration parameters using the Portlet Deployment Descriptor editor.

  1. Open the portlet.xml file (double-click the Portlet Deployment Descriptor node in the Project Explorer) in the Faces portlet project to which you want to add new modes.

  2. Click the

    Portlets tab.

  3. In the

    Portlets section on the left side, select the portlet that you want to modify.

  4. In the

    Supported Modes section , select the MIME type and click

    Edit

    1. Click

      Add, and type the mode name

    2. Click OK. The portlet.xml should look like this:

      <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>view</portlet-mode>
      <portlet-mode>edit</portlet-mode>
      </supports>

  5. In the

    Initialization section on the right side (you may need to scroll down), click the

    Add button to add a new parameter. If you merely want to change the JSP path for an existing initial page, select the parameter in the table and click

    Edit. Depending on which button you clicked, the

    New Initialization Parameter or

    Edit Initialization Parameter dialog will open.

  6. Type the appropriate mode name, based on the table below, and JSP path value (relative to the project context root) for the initial page. Click OK.

    Mode JSP path
    com.ibm.faces.portlet.page.view An initial JSP file path for the View mode
    com.ibm.faces.portlet.page.edit_default An initial JSP file path for a edit defaults mode
    com.ibm.faces.portlet.page.edit An initial JSP file path for the Edit mode
    com.ibm.faces.portlet.page.help An initial JSP file path for the Help mode
    com.ibm.faces.portlet.page.config An initial JSP file path for the Configure mode

  7. Save the portal.xml file.

If you select the

Source page and scroll to the place in the portal.xml file where configuration parameters are defined, you should see generated results similar to the following example:

<init-param>
   <name>com.ibm.faces.portlet.page.edit</name>
   <value>/jsp/MyEdit.jsp</value>
</init-param>

 

Related concepts

Creating Faces portlets and projects

 

Related tasks

Creating portlet JSP files

Adding and updating Faces portlet modes for existing IBM portlets

Changing portlet modes using a Faces action

Changing a JSF portlet page without a JSF action

Accessing portlet API objects from Faces actions and components