Override Action¶
The following describes the metadata properties to override control and action's properties that accept actions e.g.
OnLoaded
, OnResume
, OnPress
, OnSuccess
, OnFailure
,'OnPulledDown' and etc. Multi-level overriding is also
supported.
Override Action Properties¶
Property | Type | Required |
---|---|---|
Name | string |
Required |
Properties | object |
Required |
Name¶
Action that will be overridden.
- type:
string
Properties¶
Properties and their values that will be overridden. All properties and events can be overridden except _Type
.
- type:
object
Examples¶
OnLoaded Event¶
{
"Caption": "Main Page",
"OnLoaded": {
"Name": "/MyApp/Actions/Toast/ToastMessage.action",
"Properties": {
"Message": "My Message"
}
},
"_Type": "Page",
"_Name": "MainPage"
}
OnSuccess Event (Nested Actions)¶
{
"_Type": "Action.Type.ODataService.CreateEntity",
"Target": {
"EntitySet": "MyWorkOrderHeaders",
"Service": "/MyApp/Services/MyOData.service"
},
"Properties": {
"OrderDescription": "new installation",
},
"OnSuccess": {
"Name": "/MyApp/Actions/Message.action",
"Properties": {
"Message": "My Message",
"Title": "My Title",
"OnSuccess": {
"Name": "/MyApp/Actions/GoToPage.action",
"Properties": {
"PageToOpen": "/MyApp/Pages/MySecondPage.page"
}
}
}
}
}
ExecuteAction API¶
export default function OverrideActionProperties(context) {
const pageProxy = context.getPageProxy();
pageProxy.setActionBinding({
'message': "Hello"
});
return pageProxy.executeAction({
"Name": "/MyApp/Actions/Message.action",
"Properties": {
"Message": "My Message is {message}",
"Title": "My Title"
}
});
}
ExecuteAction API (Override Object Properties)¶
export default function OverrideActionProperties(context) {
let readLink = "MyWorkOrderHeaders('4000019')";
let description = "Override Description";
return context.executeAction({
"Name": "/MyApp/Actions/UpdateEntity.action",
"Properties": {
"Target": {
"ReadLink": readLink
},
"Properties": {
"OrderDescription": description
},
}
});
}