1# Widget Event Capability Overview 2 3 4The ArkTS widget provides the **postCardAction()** API for interaction between the widget internal and the provider application. Currently, this API supports the router, message, and call events and can be called only in the widget. 5 6 7![WidgetPostCardAction](figures/WidgetPostCardAction.png) 8 9 10Definition: postCardAction(component: Object, action: Object): void 11 12 13Parameters: 14 15 16| Name| Type| Mandatory| Description| 17| -------- | -------- | -------- | -------- | 18| component | Object | Yes| Instance of the current custom component. Generally, **this** is transferred.| 19| action | Object | Yes| Action description. For details, see the following table.| 20 21 22Description of the action parameter 23 24 25| **Key** | **Value** | Description| 26| -------- | -------- | -------- | 27| "action" | string | Action type.<br>- **"router"**: application redirection. If this type of action is triggered, the corresponding UIAbility is displayed. Only the UIAbility of the current application can be displayed.<br>- **"message"**: custom message. If this type of action is triggered, the [onFormEvent()](../reference/apis/js-apis-app-form-formExtensionAbility.md#onformevent) lifecycle callback of the provider FormExtensionAbility is called.<br>- **"call"**: application startup in the background. If this type of action is triggered, the corresponding UIAbility is started but does not run in the foreground. The target application must have the permission to run in the background ([ohos.permission.KEEP_BACKGROUND_RUNNING](../security/permission-list.md#ohospermissionkeep_background_running)).| 28| "bundleName" | string | Name of the target bundle when **action** is **"router"** or **"call"**. This parameter is optional.| 29| "moduleName" | string | Name of the target module when **action** is **"router"** or **"call"**. This parameter is optional.| 30| "abilityName" | string | Name of the target UIAbility when **action** is **"router"** or **"call"**. This parameter is mandatory.| 31| "params" | Object | Additional parameters carried in the current action. The value is a key-value pair in JSON format.| 32 33 34Sample code of the **postCardAction()** API: 35 36 37 38```typescript 39Button ('Jump') 40 .width('40%') 41 .height('20%') 42 .onClick(() => { 43 postCardAction(this, { 44 'action': 'router', 45 'bundleName': 'com.example.myapplication', 46 'abilityName': 'EntryAbility', 47 'params': { 48 'message': 'testForRouter' // Customize the message to be sent. 49 } 50 }); 51 }) 52``` 53 54 55The following are typical widget development scenarios that can be implemented through widget events: 56 57 58- [Updating Widget Content Through FormExtensionAbility](arkts-ui-widget-event-formextensionability.md) 59 60- [Updating Widget Content Through UIAbility](arkts-ui-widget-event-uiability.md) 61 62- [Redirecting to a Specified Page Through the Router Event](arkts-ui-widget-event-router.md) 63