Enabling cooperative targets without a Faces action
When a cooperative target is a Faces portlet, the target page is not required to contain a Faces action. This is a design choice. If the target Faces page expects only one type of input value, it is not necessary to associate it with a Faces action.
To enable a cooperative target in this way, follow these steps:
- 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.
- Right-click the desired portlet, and select
Cooperative | Enable this Portlet to Receive Data from the pop-up menu. The
Cooperative - Enable this Portlet to Receive Data wizard appears. Alternatively, open a JSP file, ensure that it has focus, and select the
Page | Cooperative | Cooperative - Enable this Portlet to Receive Data menu choice.
- Provide any appropriate values in the
Cooperative - Enable this Portlet to Receive Data wizard, as described in Enabling cooperative targets. However, you should supply the following values:
- Browse to specify JSP.
- Specify a request parameter name in the
[Parameter] Parameter field.
- Select Request parameter from the
Bound to drop-down list.
- Click OK. The Click-to-Action-enabled portlet is shown with a target portlet icon () in the Project Explorer view.
- Use the request parameter to initialize or update data to be displayed in the JSP file. Edit the page code associated with the JSP file.
For example:
public TicketList getTicketList() { if (ticketList == null) { ticketList = (TicketList) getFacesContext().getApplication().createValueBinding("#{ticketList}").getValue(getFacesContext()); String customerId = (String)getRequestParam().get("customerId"); if (customerId != null) { ticketList.setCustomerId(customerId); } } return ticketList; }
Related reference
Web Services Description Language (WSDL) 1.1
WebSphere Portal Information Center