$.udb.navigateToRelated()
This article is about the navigateToRelated() function of the udb object.
$.udb.navigateToRelated()
Navigates to a related page.
Returns a UdbPromise object.
If you navigate away from a page, asynchronous operations are in risk of being annulled if they do not return a promise (as opposed to just executing with an undefined result).
Syntax
$.udb.navigateToRelated( *pageName*, [*options*] )
.then(() => {
// success (executed on the related page)
})
.catch(() => {
// failure (executed on the original page)
})
.finally(() => {
// executed after success / failure is handled
});
*options* ::= {
[quiet]: *quiet*,
[pageTarget]: *page-target*,
[title]: *title*
}
*quiet* ::= { true | [false] }
*page-target* ::= String { "Dialog" | "Page" | ["Current"] }
*title* ::= String ["${PageTitle}"]
The required pageName identifies the related page to be navigated to.
Options is a struct that can have the following items, all of which are optional.
Page-target is a string specifying whether the page must be displayed as a dialog or a regular page. As dialog, the page is displayed as a modal dialog. As regular page, the page is displayed as the contents of the targetted frame context. The option page-target considers these strings as valid values:
"Dialog": the page is displayed as modal dialog"Page": the page is displayed normally"Current"(default) : the page is displayed in the same manner that is used for the previous displayed page.
Title has an effect only if page-target is set to "Dialog". Title is a string representing the dialog title to be used. The string "${PageTitle}" denotes the page's 'Title' property in the Web Designer to be used.
Quiet is a boolean that determines whether or not a message is displayed if an error occurs. Default is false, meaning that a message is displayed by default.
Example
$.udb.navigateToRelated('Departments',
{quiet: true} )
.then( () =>
$.udb("DEPT").executeQuery({ hostvars: { ... }});
);
Related events
| Event | Applies to | Occurs when |
|---|---|---|
| beforenavigate | Page objects | Before navigation to a different page takes place |
| startpagecomplete | Page objects | After the new page is displayed |