OpenWGA 7.10 - TMLScript reference

Design
Method :

resolve([dbkey, ] reference)

On object Design
Usage Resolves a design reference relative to the current base reference
Description

This method can be used to address another design resource relatively to the base reference of the current Design object.

It takes all forms of relative addressation possible in WebTML into account, like local and overlay references, and therefor can be used just like the design reference attributes in WebTML tags like ref of <tml:include>.

The result of this method is again a Design object whose base reference points to the resolved design resource name. You can use it to perform the available operations of the Design object with it as reference, for example to generate a layout URL to a WebTML module of the given name, or to retrieve the WGAPI counterpart of a resource of that name via getFileContainer() / getScriptModule() / getTMLModule().

Parameters

dbkey (String, optional):

The database key of the app whose design contains the adressed design resource

reference (String):

A design reference string

Return value A new Design object pointing to the resolved design resource
Examples

Fetching a Design object pointing to design name "dialogs:choosedoc", then generate a layout URL to a WebTML module of that name:

WGA.design().resolve("dialogs:choosedoc").layoutURL()

An example of relative adressation: Assuming that the following code is inside a script block in a WebTML module of  "layout:body" this will fetch the Design object for another WebTML module in the same directory "layout:header" and then retrieves the WGAPI object for it:

WGA.design().resolve("::header").getTMLModule("html")