[Working with scripts]: Dynamic Content

This sample demonstrates how to render different sections based on different values. During the rendering stage, the Render If the script will run.

The following is an example:

1/ Add in the following script in the Section Wizard/Scripts under Render If for Section 1:

=Code Snippet=
var ds = DataCacheManager.getCache("DataSource 1");
ds.getString("Fruit") == "Apple";

2/ Add in the following script in the Section Wizard/Scripts under Render If for Section 2:

=Code Snippet=
var ds = DataCacheManager.getCache("DataSource 1");
ds.getString("Fruit") == "Orange";

An explanation for the above is:-

Section 1 will execute if the value from the datasource is “Apple” and execute Section 2 if the datasource is “Orange”.

Dynamic_Control_Section.zip (3.3 KB)