on 09-22-2023 6:32 AM
Hello everyone,
I am developing a custom widget for the SAC and want to use the Analytics Designer API (https://help.sap.com/doc/958d4c11261f42e992e8d01a4c0dde25/release/en-US/index.html).
In my case I want to be able to change the viewed story from the inside of my custom widget code. So I defined a function that looks like this:
class Widget extends HTMLElement {
changeStory(storyId,pageId){
NavigationUtils.openStory(storyId,pageId);
}
...
}
The problem that I face is that the call of the "changeStory"-function throws following error: Uncaught ReferenceError: NavigationUtils is not defined.
Now my question is how I could access the NavigationUtils Component from the inside of my code (https://help.sap.com/doc/958d4c11261f42e992e8d01a4c0dde25/release/en-US/index.html#NavigationUtils).
Thanks and best regards
Michael
Depends on your case. If the method does not need access to the DOM you can implement it in contribution JSON (see https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/0ac8c6754ff84605a4372468d002f2bf/bde41c0b637b49fbb4e79.... There you have access to type libraries you imported (https://help.sap.com/docs/SAP_ANALYTICS_CLOUD/0ac8c6754ff84605a4372468d002f2bf/0dab4c7d40e64ee0b3017f06d983f3da.html). NavigationUtils is in standard library, which is always included.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could put the part where you need DOM access into a dedicated method which you implement in the web component and call that one from the other method. Not sure whether there are other options.
var value = this.getSomethingFromDom()
var url = // do something with value
NavigationUtils.openStory(...)
User | Count |
---|---|
71 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.