ClosePage¶
While closing the pages, you can either choose to terminate all the ongoing events or wait until they are executed successfully.
All the properties defined under Action are applicable to this action. Not supported in TabPages
ClosePage Properties¶
| Property | Type | Required | Default |
|---|---|---|---|
| CancelPendingActions | boolean |
No | false |
| DismissModal | enum |
No | |
| NavigateBackToPage | string |
No | |
| _Type | const |
Yes |
CancelPendingActions¶
Indicates whether the pending actions in the queue must be cancelled or not.
- type:
boolean - default:
false
DismissModal¶
Indicates how the page must be closed.
- type:
enum
The value of this property must be one of the known values listed below.
| Value | Description |
|---|---|
Action.Type.ClosePage.Completed |
Closes the page after all the pending actions are executed. |
Action.Type.ClosePage.Canceled |
Ends the ongoing action execution and all the pending actions in the queue and closes the page. |
NavigateBackToPage¶
This property allows you to navigate back to a specific page in the navigation history stack. It accepts the _Name
property of the page you want to navigate back to. If the specified page is not found in the navigation history stack
then this action will fail, and the current page will not be closed. If the specified page is found in the navigation
history stack then the current page will be closed, and you will be navigated to the specified page. The pages between
the current page and the specified page in the navigation history stack will be disposed and their OnReturning event
will not be triggered.
Notes: This property will be ignored if DismissModal or CancelPendingActions properties are defined. You can only
navigate back to a page within the same frame. For example, if you are closing a page inside a modal frame, then you
can only specify a page name that's within the same modal's navigation history stack. You can't specify a page that is
in the main navigation history stack behind the modal.
- type:
string
_Type¶
- type:
const
The value of this property must be:
"Action.Type.ClosePage"
Action Result¶
Refer to the MDK Guide to understand what an action result is.
The success ActionResult of this action is null. The failure ActionResult is an error message.
Examples¶
Close page¶
Normal close
{
"_Type": "Action.Type.ClosePage"
}
Cancel pending actions and close the page¶
A typical use case is a changeset action execution. When the user closes the last modal page that has a changeset action, all the pending actions in the queue are ended and the modal page is closed.
{
"_Type": "Action.Type.ClosePage",
"DismissModal": "Action.Type.ClosePage.Cancel"
}
Close the page only after the pending actions are executed¶
A typical use case is a changeset action execution. When the user closes the last modal page that has a changeset action, all the pending actions lined up in the queue are executed and only then the modal page is closed.
{
"_Type": "Action.Type.ClosePage",
"DismissModal": "Action.Type.ClosePage.Completed"
}
Multiple back navigation¶
NavigateBackToPage will allow the users to navigate back to the defined page. This property accepts the name of the target page as the input (target page name is assigned to _Name of the page). If you have multiple pages opened with the same name in the navigation stack, the NavigateBackToPage reference will return to the most recent occurance of the specified page name.
Note: OnReturning events bound to pages between the current page and the page specified by the NavigateBackToPage are not triggered.
A typical use case is when you are in a product list page with _Name as "ProductList" and go through several pages to create an entity. After the entity is created, you want to go back to the product list page directly.
{
"_Type": "Action.Type.ClosePage",
"NavigateBackToPage": "ProductList"
}