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

  1. Add a widget to the canvas, for example a dropdown.

    The specific icon and name of the application are displayed in the Outline.

  2. Hover the mouse over the widget name.

    A button is displayed right next to the widget name.

  3. Click on the button. If the widget supports multiple events, select one of the events and click on the button.
    Note

    You 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 Code
    var 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.

  4. Drag and drop a tab horizontally to change its display order if needed.
  5. Close the tab by clicking on the button at the right of the tab.