OverviewSingleDeprecatedPropertiesEventsXSL Parameters

jsx3.gui

class Template

Object
->jsx3.lang.Object
  ->jsx3.gui.Template

class Template
extends jsx3.lang.Object
Provides template related services to the base template class, jsx3.gui.Template.Block. See the compile method for usage details.

Since:

3.6

Nested Class Summary
jsx3.gui.Template.Block
Provides base class for creating custom GUI classes.
Constructor Summary
void
instance initializer
Method Summary
static void
addLibrary(strLibraryId : String, arrLibrary : Array<Object>)
Adds a resolver library.
static Object
addResolver(strSetId : String, strResolverId : String, objResolver : Object, META : Object)
Adds a resolver to a given resolver set.
static void
compile(Markup : String | jsx3.xml.Document, objClass : jsx3.lang.Class, bCache : boolean)
Converts an HTML template into the relevant JavaScript functions needed by the GUI class.
static String
precompile(strClassName : String, strPrototypeName : String, strQualifiedName : String)
Call this method during GUI class development to see how your XML template is converted into JavaScript by the template compiler.
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf, toString
Constructor Detail

init

void init()
instance initializer
Method Detail

addLibrary

static void addLibrary(strLibraryId : String, arrLibrary : Array<Object>)
Adds a resolver library. A resolver library is a collection of one or more resolvers. Libraries allow resolvers belonging to different sets to be organized into a related group. This simplifies how resolvers are grouped and used as they are shared among classes. Note that a library is automatically created for each class that uses the template engine. For example, if a GUI class named my.Example is compiled by the template, a library will be created named my.Example. Any other GUI class can now use every resolver made available to my.Example, by importing this named library.

Parameters:

strLibraryIdThe ID for this library.
arrLibraryAn array of objects. Each object has the named properties: id, setid (optional if id is prefixed with a $).

addResolver

static Object addResolver(strSetId : String, strResolverId : String, objResolver : Object, META : Object)
Adds a resolver to a given resolver set.

Parameters:

strSetIdIf not provided, the global resolver ID will be used: jsx3.gui.Template
strResolverIdUnique ID for the resolver among all resolvers in this set
objResolverfunction handler. The resolver always executes in context of the instance being painted
METAExtended configuration object with named properties:
  • type (css (default)| attribute | event | box)
  • repaintupdate (true | false (default))
  • name (the name of the attribute or style (i.e., background-color))
  • triggers (array of named triggers that will cause this resolver to update when called)
  • defaultvalue (if the resovler function returns null, this value will be used)

Returns:

Resolver object just created  

compile

static void compile(Markup : String | jsx3.xml.Document, objClass : jsx3.lang.Class, bCache : boolean)
Converts an HTML template into the relevant JavaScript functions needed by the GUI class. See jsx3.gui.Template.Block for example usage.

Parameters:

MarkupString of XML that validates against the Schema, http://gi.tibco.com/transform/
objClassAn instance of jsx3.lang.Class
bCache

Throws:

{jsx3.lang.Exception}if strMarkup does not validate or objClass is not an instance of jsx3.lang.Class

See Also:

jsx3.gui.Template.Block

precompile

static String precompile(strClassName : String, strPrototypeName : String, strQualifiedName : String)
Call this method during GUI class development to see how your XML template is converted into JavaScript by the template compiler. Using the precompiled JavaScript can provide to-the-line debugging information when difficult bugs appear in your GUI class. To use for testing, copy the JavaScript code returned by this method and paste into your GUI class. Make sure that when you paste it, it is the last statement contained by the class. If you paste the generated JavaScript BEFORE the call to 'getTemplateXML', it will be clobbered by the generated code. The code returned by this method reflects the exact methods and properties injected by the template class when it converts the markup returned by getTemplateXML into JavaScript.

Parameters:

strClassNameThe name of the class to precompile. For example, WIDGET. This should also be the name of the class as contained within the defineClass method where the given class is instantiated
strPrototypeNameOptional. The prototype name per the class declaration. For example, widget
strQualifiedNameOptional. The full name of the class, including the package (use if the class does not belong to the jsx3.gui package). For example, jsx3.ext.SomeRedBoxClass

Returns:

JavaScript function code