OpenWGA 7.0 - TMLScript reference

TMLContext "this"
Method :

isselected()

On object TMLContext "this"
Usage Returns if the current document is the main document of the current request or an ancestor document of it
Description This is a tool function for building navigators, where often the document that currently is displayed along with all its parent documents should be shown in a special "selected" mode.

The document that is "displayed" in a WebTML request is the main document, and this method tests if the document currently in context is this main document, or if it is a document that is an "ancestor" of it, i.e. that is somewhere in the parents path of the main document. If this method returns true, the navigator should display the document in some special selected mode.
Return value (Boolean)
Allowed in script types
  • WebTML pages and normal WebTML actions
Examples Assuming the following document hierarchy:
  • Root1
  • Root2
    • Child1
    • Child2
      • Grandchild1
      • Grandchild2
    • Child3


When calling a WebTML page with document "Grandchild1" as main document, the method isSelected() will return true for the following documents:

  • Grandchild1
  • Child2
  • Root2


But will return false on:

  • Grandchild2
  • Child1
  • Child3
  • Root1
Though some of these documents are in the hierarchy "above" the main document they are no real ancestors, since the parents line from "Grandchild1" to "Root2" does not contain them.