Relation to cooperative portlet wiring
You can use both live text elements and cooperative portlet wires to exchange data between portlets on a page.
However, the execution flow for both methods is different:
Flow for cooperative portlet wiring:
- The source portlet renders an action link.
- The user clicks a link to execute the source portlet action.
- The source portlet action is executed on the server, producing the source data and triggering the wires.
- The wires fire target portlet actions that are executed with the source data.
Flow for click-to-actionThe following table lists differences that will help you decide which method for data exchange is appropriate for application:
- The source portlet renders a source HTML tag that contains the source data.
- The user clicks on the source element to open a menu and selects the target action from the menu
- The source data is sent to the server where a target portlet action is executed with the source data.
Click to action Portlet wires Is based on dynamic presence of targets on a page. Is based on static administrator-defined wires. Triggers a single target selected from a menu. Triggers all defined targets that have been wired up. Can only handle string data. Can pass complex data types.
Notes:
- You can write portlets that support both methods; any portlet action declared in a cooperative portlet WSDL that defines an input parameter is available as a target for both click-to-action and portlet wiring. For sources, you can add a preference that lets the administrator control whether click-to-action live text should be emitted, as demonstrated by the cooperative portlet JSR shipping example.
- You can also combine both methods: a target action that is triggered by click-to-action can have wires attached that will propagate to other portlet actions on the server within the same request. consequently, a single click-to-action menu selection can trigger multiple portlet actions on the server.
Parent
Live text for click-to-action
Live text formats
Integrate click-to-action targets with the person menu
Comparison of the new features with click-to-action in IBM portlets
Portlet communication