Application pages support and navigation.
- Source:
Methods
(static) getActivePageId() → {String|undefined}
stable API
Gets the page ID of the currently active page, can be undefined.
- Version:
- 16.3.5
- Source:
Returns:
ID of the active page or undefined in case not beeing in the Page Designer
- Type
- String | undefined
Example
Shows welcome dialog related to current page ID.
// gets the active page ID
var activePageId = Abcs.Pages().getActivePageId();
// shows notification
Abcs.UI().showNotification(Abcs.UI().Notification.create({
message: 'Welcome on the page \'' + activePageId + '\'.'
});
(static) getHomepageId() → {String}
stable API
Gets the page ID of the homepage.
- Version:
- 16.3.5
- Source:
Returns:
ID of the home page
- Type
- String
Example
Alternative way how to navigate ABCS to home page.
// gets the homepage ID
var homepageId = Abcs.Pages().getHomepageId();
// navigates to the homepage (using the Page's ID)
Abcs.Pages().navigateToPage(homepageId);
(static) navigateHome() → {Promise}
stable API
Navigates application to the homepage.
- Version:
- 15.4.5
- Source:
Returns:
Can be used when you want to chain another operation after the page switch.
- Type
- Promise
Examples
Navigates user back to the homepage.
Abcs.Pages().navigateHome();
Navigates user back to the homepage with the chained action (opened alert message).
Abcs.Pages().navigateHome()
.then(function() {
// after the page switch open the alert dialog
alert('you are on HOMEPAGE now');
});
(static) navigateToPage(pageId, contextualDataopt) → {Promise}
stable API
Navigates application to the given page.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
pageId |
String | ID of the page where to navigate to |
||
contextualData |
viewmodel/js/api/context/ContextualData |
<optional> |
emptyContext | context to be passed to the page. Defaults to empty context (ContextualData.createBlankPageContext). |
- Version:
- 15.4.5
- Source:
Returns:
Can be used when you want to chain another operation after the page switch.
- Type
- Promise
Examples
Navigates user to the page specified by the page ID ('home').
Abcs.Pages().navigateToPage('home');
Navigates user to the page specified by the page ID ('home'). During the call it provides context of the caller page which can help to return back to the original page. After the page switch a chained action (alert dialog) is invoked.
var blankPageContext = ContextualData.createBlankPageContext({caller:'currentPageId'});
Abcs.Pages().navigateToPage('home', blankPageContext)
.then(function() {
// after the page switch open the alert dialog
alert('you are on "home" now');
});