OpenWGA 7.9 - TMLScript reference

TMLPortlet "portlet"
Property :

context

On object TMLPortlet "portlet"
Usage Gets/sets the portlet context
Description

The portlet context is a WebTML context that is automatically set for the current WebTML portlet when it is rendered. By default it is null, which means that the portlet will be rendered normally in the context that is given to it from its parent tag.

This is the TMLScript equivalent to the WebTML attribute portletcontext.

Default value null
Writable True
Return value TMLContext object
Allowed in script types
  • WebTML pages and normal WebTML actions
Examples

An example where the portlet context is set to the execution context of a WebTML action. As a single action link is rendered for each document of a WebTML navigator the portlet context will be set to the document whose action link is clicked.

Along with setting the portlet context we here also change the portlet mode so the portlet renders a design that is capable of displaying the data of the chosen document.

<tml:action id="setContext">

portlet.context = this;

portlet.mode = "view-doc";

</tml.action>


<ul>

<tml:navigator type="children">


  <li><a href="<tml:url action="setContext"/>"><tml:meta name="title"/></a>


</tml:navigator>

</ul>