Enabling cooperative sources with a Faces action

To enable a cooperative source for Faces portlet, you can use a Command - Hyperlink component in place of a Click-to-Action component to trigger portlet communication.

  1. In the Project Explorer view, select a portlet or the Portlet Deployment Descriptor. Portlets are displayed when you expand the Portlet Deployment Descriptor node under the portlet project folder.
  2. Right-click the desired portlet, and select Cooperative > Enable Source from the pop-up menu. The Enable Cooperative Source dialog opens. Alternatively, open a JSP page, ensure that it has focus, and select Page > Cooperative > Enable Source from the menu.
  3. Provide the appropriate values in the Enable Cooperative Source dialog box. (See Enabling cooperative sources for a complete description of the fields included in this dialog box.) Click OK.
    Here is an example of the code created in the WSDL file:
    <portlet:action type="standard" name="showTickets" caption="Show Tickets"></portlet:action>
         <output>
              <portlet:param name="customerId" partname="customerId_Output"
                   boundTo="request-attribute" caption="Customer ID"></portlet:param>
         </output>
    The cooperatively-enabled portlet is shown with a source portlet icon ( Cooperative source portlet icon) in the Project Explorer view.
  4. Insert a Command - Hyperlink component in the appropriate JSP file.
  5. In the Properties view, add a parameter to the Command - Hyperlink component named com.ibm.portal.propertybroker.action, with a value that is the action name specified in the WSDL file. For example:
    <f:param name="com.ibm.portal.propertybroker.action" value="showTickets"></f:param>
  6. In the Quick Edit view, for the Faces action associated with the Command - Hyperlink component, store the data to send to the target using the parameter name and scope (specified with the boundTo attribute) in the WSDL file. For example:
    getRequestScope().put("customerId", customerId);
Related concepts
Developing cooperative portlets
Related tasks
Enabling existing portlets for cooperation
Enabling cooperative sources
Enabling cooperative targets
Inserting Click-to-Action encodeProperty
Inserting Click-to-Action encodeProperties
Editing Click-to-Action encodeProperty
Editing Click-to-Action encodeProperties
Related reference
Web Services Description Language (WSDL) 1.1
WebSphere Portal Information Center
XML Schema Part 2: Datatypes

(C) Copyright IBM Corporation 2002, 2005. All Rights Reserved.