Script Model

In your applications the data flows into UI element via property bindings and flows out of UI element through event bindings. For different UI controls you can define different types of events. For example, a Button-Single can initiate a process in the event of click, and a Selector-Radio can call a function. You can bind the events to various UI controls that you add to your app views using Script designer with a low code / Zero code approach.

You can design a script model in association with the page life cycle events or certain UI controls.

The script model is a graphical representation of one or more actions to perform in the event of specified action.

Perform the following steps:

  1. From your app view open the script designer in one of the following ways:
    1. To associate the script model to your app view, click Page Life Cycle .
    2. To associate the script model to a UI control, select the UI control, go to the Settings tab, and click Actions.
  2. In the Script designer select the event as applicable from the Select Events drop-down list.
  3. Along with the task elements, the following options are available in the task bar to effectively use the canvas:
    • Undo and Redo: Undo and redo your last or previous action or edit. You can use this option only if you have not saved the view since making the last changes.
    • Reset Scroll: Resets the script model to the position where the start event is placed if you have scrolled away on the canvas.
    • Clear: Removes all the elements added to the canvas.
    • Full View: Expands the script model to open in the full browser window for ease of view. Click the Full View icon again to resume to normal view.
  4. Add the following elements in the same order:
    1. Start: The start event is the first step in a script model that initiates the specified actions.
    2. Task: The task represents the actions to perform based on the specified event associated with the corresponding view or UI control. For different UI controls different events can execute the script model. For example, a button can execute the associated script model in the event of On Click, and a card can execute the associated script model in the event of On Hover. In any script model you can use the following types of tasks:
    3. End: The end event is the last step in a script model that completes the flow of specified actions.
  5. Click Validate Model. Each task that you added in the script model is validated and displays the validation errors if any. Update the details of the tasks as identified in the validation errors.
  6. Click Save after all the validation errors are fixed.
  7. The script model is created successfully.

    Optionally click Export to generate a script file in .JSON format. This file is downloaded to your local computer. You can use this file to create another script model and modify as required. Click Import to add the script model file that you exported previously.