OpenWGA 7.10 - TMLScript reference

TMLContext "this"
Method :

isFirstLoop([Tag-ID])

On object TMLContext "this"
Usage Tests if a tag <tml:foreach> is in its first iteration
Description This method tests either a <tml:foreach> tag whose tag id is given as parameter or the nearest <tml:foreach> tag in which the tag executing the script is contained.

However for making sense the tag whose ID is given should be a tag that is currently in its iteration loop. Therefor it must be a tag that contains the tag executing the script on some level.
Parameters Tag-ID (String, optional):
ID of the <tml:foreach> tag to test. Omit to use the nearest <tml:foreach> tag up the tag hierarchy
Return value true, if the that is in its first iteration, false otherwise
Allowed in script types
  • WebTML pages and normal WebTML actions
Examples Putting out some code only on the the first iteration:

<tml:foreach>
  <tml:link/><br>

  <tml:case condition="isFirstLoop()">
    <br><b>Further results:</b><br>
  </tml:case/>

</tml:foreach>