Adding a Script to a Widget
You can write event handlers for widgets and other events to create interactive applications with custom-defined behavior.
Procedure
-
Add a widget to the canvas, for example a dropdown.
The specific icon and name of the application are displayed in the Outline.
-
Hover the mouse over the widget name.
A
button is displayed right next to the widget name. -
Click on the
button. If the widget
supports multiple events, select one of the events and click on the
button.
NoteYou can also use the
button in the quick action menu of each
widget you have placed in your application. A new tab is automatically created in the script editor, where you can add scripts for the widget. For example, the following code gets the selected text of a dropdown:Sample Codevar selectedText = Dropdown_1.getSelectedText();
You can find all objects, fields and functions available in scripts in the Analytics Designer API Reference on SAP Help Portal at Analytics Designer API Reference.
- Drag and drop a tab horizontally to change its display order if needed.
-
Close the tab by clicking on the
button at the right of the
tab.
Related Information