Property "Generate Conditions As" <genas>

Top  Previous  Next

"Generate Conditions As" property of the Condition Panel determines how the condition elements of the condition panel are generated during the build process.

Generate As "xsl:when":

The code generated for the condition is enclosed with <xsl:when> and </xsl:when> tags as follows.

 

<xsl:choose>

<xsl:when test="test for condition 1">

<!-- code for condition 1 -->

</xsl:when>

<xsl:when test="test for condition 2">

<!-- code for condition 2 -->

</xsl:when>

</xsl:choose>

 

 

The Displaying the content of the condition is determined by the XSLT processor after evaluating the expressions in test attributes of the when tags.

 

Generate As  "div"

The code generated for each condition in the condition panel is placed in <div> tags in HTML. It is up to the user to manage the divs using javascripts.

<div id="condpanel1_condition1">

<!-- code for condition 1 -->

</div>

<div id="condpanel1_condition2">

<!-- code for condition 2 -->

</div>

 

 

The user can manipulate the divs with javascripts to make them visible or invisible, or to re-position them on the browser.

As shown above, the Application Studio automatically creates id attributes for the div tags to make them accessible by the javascripts.

Example:

elm = document.getElementById('condpanel1_condition1');

elm.style.display = 'none'; // makes the condition1 invisible

 

elm = document.getElementById('condpanel1_condition2');

elm.style.display = 'inline'; // makes the condition2 visible

 

Note: The first part of the auto-generated id is the value of the elmid property of the Condition Panel element. It can be accesses using %vof() function.

Example:

elm = document.getElementById('%vof(/CondPanel1/elmid)_condition1');