Script

You can find more information about the WEMScript in the specific pages. There is a page about the WEMScript for Custom HTML, and WEMScript for Widgets.

With the Script widget you can add HTML code and other script code (like JavaScript) to the Template Editor.

Note: when you use the Script widget, it is possible to overwrite (intended or unintended) the Design Template settings.

Drag and drop the Script widget to the Template Editor and the box below appears.

Illustration

Let's build upon the EMS use case from where we had left at in the page for 'Nested Templates'. We had built an interaction template with a Tabbar consisting of two tabs and Datagrids inside Conditionals that should be displayed based on the tab clicked. The 'Projects' tab at run-time was something like the below.

Let's say that we now have this requirement - the total number of projects should be shown below the table, in red font.

  1. Open the 'Projects' Template Fragement.

  2. Insert a Label below the Table, which would show a count of the number of projects.

  3. Click and drag the 'Script' icon and place it above the Label.

  4. Compose your Script and then click on 'Validate'.

  5. Repeat steps 3 and 4 for closing the script, but below the Label.

  6. Click on 'Save' in the Template Editor. When you preview, you will now see the Label in red below the Table.

Last updated