A source portlet uses a C2A event to send data to a target portlet.
Use the Cooperative Portlet Source builder to add a C2A event to your model.
- C2A events in a source model
- Tag attributes
C2A events in a source model
To enable the source model for C2A events, add a Cooperative Portlet Source builder call. The Cooperative Portlet Source builder places the <C2A:encodeProperty/>
tag on a model page and specifies what data to send to the target portlet. These tags are used to build a menu that can fire a C2A event to a target portlet on the same page that matches the specified type. The Type
input in the Cooperative Portlet Source builder call editor specifies which of the two tags are used.
- Select C2A Single Action for the <C2A:encodeProperty/> tag.
- Select C2A Multiple Action for the <C2A:encodeProperties/> tag.
For information about tag attributes, see Tag attributes .
A Cooperative Portlet Source builder call supports either a Single Action or Multiple Action type, but not both at the same time. However, you can add two Cooperative Portlet Source builder calls to a model, with one builder call configured to C2A Single Action and there other to C2A Multiple Action.
Because you expose the source model as a IBM® WebSphere® Portal portlet, you must add the Portlet Adapter builder to the model.
tag has the following attributes, which are passed to the target portlet.
Table 1. Attributes of the tag
|Attribute ||C2A Menu Input Field||Description|
|value||Value||The data to be sent by the source portlet.|
|type||Input Type Name||The type of data to be sent by the source portlet. The Click-to-Action runtime uses the type and namespace attributes to match source data to actions on targets.|
|namespace||Namespace||The namespace for the type. This attribute is used to group related types in a single domain.|
|broadcast||Broadcast||If set to true, the source data is broadcasted to all target portlets with matching actions, and the generated menu will display an item to broadcast the source to all matching targets. The default is false. |
|generateMarkupWhenNested||Generate When Nested||If set to true, the tag will generate markup even when nested within the <C2A:encodeProperties/> tag. The default is false.|
tag is used to allow the user to send multiple related sources to target portlet with one click. In this scatter action, multiple <C2A:encodeProperty/>
tags are enclosed within one <C2A:encodeProperties/>
tag. Because each <C2A:encodeProperty/>
tag contributes one source data object for the scatter, each of these tags must specify a different type attribute. The <C2A:encodeProperties/>
tag generates a menu with one item. When the item is selected by the user, each action that matches a <C2A:encodeProperty/>
tag is invoked simultaneously.
Parent topic: Enabling Click-to-Action