Defining a widget event
You can define events as part of the page widget definition. You can define incoming events that provide handlers for events that are received by the page widget. You can also define outgoing events that are published by the page widget. Outgoing events can be either broadcast or wired.
The following table lists the properties that you define for an event.
| Property | Required or Optional | Type | Description |
|---|---|---|---|
| id | Required | String | The unique identifier for the event. |
| title | Required | String | The title of the event or event handler. |
| functionName | Required | String | For an incoming event, the name of the function that handles the event. This property is not used for outgoing events. |
| direction | Required | String | Indicates whether the event is incoming or outgoing. Set to subscribed for an incoming event and published for an outgoing event. |
| type | Required | String | For an outgoing event, indicates whether the event is broadcast or wired. Set to broadcast for an event that is broadcast and set to wiring for an event that must be wired. |
| description | Optional | String | A description of the event. This text is used as hover help for the event in the Wiring window. |
The following code shows how events are defined in the page widget definition
file.
"events":[
{
"id":"icm.RoleChanged",
"title":"Role selected",
"functionName":"handleReceiveRole",
"direction":"subscribed",
"description":"Update the In-baskets widget to display the
in-baskets that are associated with the specified role."
},
{
"id":"icm.SelectRow",
"title":"Row selected",
"functionName":"handleSelectRow",
"direction":"published",
"type":"wiring",
"description":"The user clicked a row or pressed enter
in the in-basket to select the work item."
},
{
"id":"icm.OpenCase",
"title":"Open Case",
"functionName":"handleOpenCase",
"direction":"published",
"type":"broadcast",
"description":"Open a case object."
}
]