OverviewSingleDeprecated

jsx3.gui

class Tree

Object
->jsx3.lang.Object
  ->jsx3.app.Model
    ->jsx3.gui.Painted
      ->jsx3.gui.Block
        ->jsx3.gui.Tree

All Implemented Interfaces:

jsx3.gui.Form, jsx3.gui.Interactive, jsx3.util.EventDispatcher, jsx3.xml.CDF, jsx3.xml.Cacheable

class Tree
extends jsx3.gui.Block
Creates a DHTML-based navigational trees (similar to the tree structure used by Windows Explorer with folders and files). This class expects XML source adhering to standards for version 3.0, the Common Data Format.

The Tree class by default supports the following CDF attributes: This class publishes the following model events:

Field Summary
static String
APPEND_IMG
jsx:///images/matrix/append.gif
static String
BORDERCOLOR
#8CAEDF (default)
static String
DEFAULTBACKGROUNDCOLOR
#ffffff (default)
static String
DEFAULTNODATAMSG
  (default)
static String
Deprecated.
static String
DEFAULTXSLURL
static String
ICON
JSX/images/tree/file.gif (default)
static String
ICONMINUS
JSX/images/tree/minus.gif (default)
static String
ICONPLUS
JSX/images/tree/plus.gif (default)
static String
INSERT_BEFORE_IMG
jsx:///images/matrix/insert_before.gif
static int
MULTI
Enum value for the multiSelect property indicating a multi-select tree.
static String
Deprecated.
static String
SELECTEDIMAGE
JSX/images/tree/select.gif (default)
static int
SINGLE
Enum value for the multiSelect property indicating a single-select tree.
Constructor Summary
void
init(strName : String, strId : String)
instance initializer
Method Summary
int
validates the Tree; if the Tree is set to 'required', a selection must be made to pass validation.
void
executeRecord(strRecordId : String)
Executes any bound code for the record with id strRecordId.
String
Returns the Icon to use for items in the tree.
String
Returns the Icon to use when a node is in an open state.
String
Returns the Icon to use when the given tree node is in an closed state.
int
Deprecated. Key navigation now works with sorted trees.
int
Returns whether this tree is multi- (Tree.MULTI) or single-select (Tree.SINGLE).
String
Returns the text/HTML to display on-screen when the xml/xsl transformation for this object results in a null or empty result set
int
Returns whether or not the tree should paint its root node or paint the direct child nodes to the VIEW without rendering their containing root.
String
Deprecated.
String | Array<String>
Returns the jsxid attribute for the selected CDF record/records.
static String
Deprecated.
jsx3.xml.Document
Returns XSLT for the Tree, prioritizing the acquisition in the following order: 1) check cache; 2) check jsxxsl; 3) check jsxxslurl; 4) use default
String
Returns the DHTML, used for this object's on-screen VIEW
jsx3.gui.Tree
redrawRecord(strRecordId : String, ACTION : int)
if @strRecordId equals the id of the selected option (this.getValue()), only the text property will update; returns a ref to self to facilitate method chaining
void
revealRecord(strRecordId : String, objJSX : jsx3.gui.Block)
Reveals a record by toggling parent nodes as necessary and scrolling any containing blocks within the tree.
jsx3.gui.Tree
setIcon(strURL : String)
Sets the Icon to use for items in the tree; returns a ref to self
jsx3.gui.Tree
setIconMinus(strURL : String)
Sets the Icon to use when a node is in an open state.
jsx3.gui.Tree
setIconPlus(strURL : String)
Sets the Icon to use when the given tree node is in an closed state
jsx3.gui.Tree
setKeyListener(bBoolean : int)
Deprecated. Key navigation now works with sorted trees.
jsx3.gui.Tree
setMultiSelect(intMulti : int)
Sets whether this tree is multi- (Tree.MULTI) or single-select (Tree.SINGLE).
jsx3.gui.Tree
setRoot(bBoolean : int)
Sets whether or not the tree should paint its root node or paint the direct child nodes to the VIEW without rendering their containing root;
jsx3.gui.Tree
setValue(strRecordId : String | Array<String>, bReveal : boolean)
Selects a record in the tree.
jsx3.gui.Tree
toggleItem(strRecordId : String, bOpen : boolean, bBook : boolean)
toggles the open/closed state for a node on the tree; updates both MODEL and VIEW; if the tree is not yet painted and the open state for a node needs to be set, call: [tree instance].insertRecordProperty(@strId,@strPropName,@strPropValue,false); if there is a VIEW for the item, the 'ontoggle' event will be fired; if the developer has bound an ontoggle script (e.g.
Methods Inherited From jsx3.gui.Form
doKeyBinding, doReset, getDisabledBackgroundColor, getDisabledColor, getEnabled, getKeyBinding, getRequired, getValidationState, setDisabledBackgroundColor, setDisabledColor, setEnabled, setKeyBinding, setRequired, setValidationState
Methods Inherited From jsx3.xml.Cacheable
clearXmlData, getNodeSet, getShareResources, getXML, getXMLId, getXMLString, getXMLTransformers, getXMLURL, getXSLId, getXSLParams, getXSLString, getXSLURL, getXmlAsync, getXmlBind, onXmlBinding, removeXSLParam, removeXSLParams, resetCacheData, resetData, resetXmlCacheData, resetXslCacheData, setNodeSet, setShareResources, setSourceXML, setXMLId, setXMLString, setXMLTransformers, setXMLURL, setXSLId, setXSLParam, setXSLString, setXSLURL, setXmlAsync, setXmlBind
Methods Inherited From jsx3.xml.CDF
adoptRecord, adoptRecordBefore, convertProperties, deleteRecord, deleteRecordProperty, getRecord, getRecordNode, insertRecord, insertRecordBefore, insertRecordNode, insertRecordProperty, reloadFromSource
Methods Inherited From jsx3.gui.Block
getBackground, getBackgroundColor, getBorder, getCSSOverride, getClassName, getColor, getCursor, getDimensions, getDisplay, getFontName, getFontSize, getFontWeight, getHeight, getIndex, getLeft, getMargin, getOverflow, getPadding, getRelativePosition, getTagName, getTextAlign, getTip, getTop, getVisibility, getWidth, getZIndex, hideMask, setBackground, setBackgroundColor, setBorder, setCSSOverride, setClassName, setColor, setCursor, setDimensions, setDisplay, setFontName, setFontSize, setFontWeight, setHeight, setIndex, setLeft, setMargin, setOverflow, setPadding, setRelativePosition, setTagName, setText, setTextAlign, setTip, setTop, setVisibility, setWidth, setZIndex, showMask
Methods Inherited From jsx3.gui.Interactive
doEvent, getCanDrag, getCanDrop, getCanMove, getCanSpy, getEvent, getEvents, getMenu, hasEvent, registerHotKey, removeEvent, removeEvents, setCanDrag, setCanDrop, setCanMove, setCanSpy, setEvent, setMenu, setSpyStyles, showSpy
Methods Inherited From jsx3.gui.Painted
focus, getAbsolutePosition, getAttribute, getAttributes, getDynamicProperty, getRendered, insertHTML, onAfterPaint, paintChild, paintChildren, recalcBox, removeAttribute, removeAttributes, repaint, setAttribute, setDynamicProperty
Methods Inherited From jsx3.app.Model
adoptChild, doClone, findAncestor, findDescendants, getAncestorOfName, getAncestorOfType, getChild, getChildIndex, getChildren, getDescendantOfName, getDescendantsOfType, getFirstChild, getFirstChildOfType, getHelpId, getId, getLastChild, getLoadType, getMetaValue, getNS, getName, getNextSibling, getParent, getPersistence, getPreviousSibling, getServer, getUriResolver, insertBefore, load, loadAndCache, loadXML, onAfterAssemble, onAfterAttach, onBeforeAssemble, onChangeServer, onDestroy, onRemoveChild, onSetChild, onSetParent, removeChild, removeChildren, setChild, setHelpId, setLoadType, setMetaValue, setName, setPersistence, toString, toXML, toXMLDoc
Methods Inherited From jsx3.util.EventDispatcher
publish, subscribe, unsubscribe, unsubscribeAll
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf
Field Detail

APPEND_IMG

static String APPEND_IMG
jsx:///images/matrix/append.gif

BORDERCOLOR

static String BORDERCOLOR
#8CAEDF (default)

DEFAULTBACKGROUNDCOLOR

static String DEFAULTBACKGROUNDCOLOR
#ffffff (default)

DEFAULTNODATAMSG

static String DEFAULTNODATAMSG
&nbsp; (default)

DEFAULTXSLID

static String DEFAULTXSLID
Deprecated.
JSX_TREE_XSL (default)

DEFAULTXSLURL

static String DEFAULTXSLURL

ICON

static String ICON
JSX/images/tree/file.gif (default)

ICONMINUS

static String ICONMINUS
JSX/images/tree/minus.gif (default)

ICONPLUS

static String ICONPLUS
JSX/images/tree/plus.gif (default)

INSERT_BEFORE_IMG

static String INSERT_BEFORE_IMG
jsx:///images/matrix/insert_before.gif

MULTI

static final int MULTI
Enum value for the multiSelect property indicating a multi-select tree.

ONDROPBGIMAGE

static String ONDROPBGIMAGE
Deprecated.
url(JSX/images/tree/over.gif) (default)

SELECTEDIMAGE

static String SELECTEDIMAGE
JSX/images/tree/select.gif (default)

SINGLE

static final int SINGLE
Enum value for the multiSelect property indicating a single-select tree.
Constructor Detail

init

void init(strName : String, strId : String)
instance initializer

Parameters:

strNameunique name distinguishing this object from all other JSX GUI objects in the JSX application
strIdthis value should correspond to the jsxid for the 'record' node is the selected node for the tree
Method Detail

doValidate

int doValidate()
validates the Tree; if the Tree is set to 'required', a selection must be made to pass validation. Otherwise, a Tree will always pass validation

Returns:

one of: jsx3.gui.Form.STATEINVALID or jsx3.gui.Form.STATEVALID  

Overrides:

doValidate in jsx3.gui.Form

executeRecord

void executeRecord(strRecordId : String)
Executes any bound code for the record with id strRecordId. This method only invokes the EXECUTE model event for this tree under the deprecated 3.0 model event protocol.

Parameters:

strRecordIdjsxid value for the record node (according to the CDF) to execute

getIcon

String getIcon()
Returns the Icon to use for items in the tree. Default: jsx3.gui.Tree.ICON

Returns:

 

getIconMinus

String getIconMinus()
Returns the Icon to use when a node is in an open state. Default: jsx3.gui.Tree.ICONMINUS

Returns:

URL for icon to use when given tree node is toggled to closed; if null, value is reset to use URL referenced by jsx3.gui.Tree.ICONBOOKCLOSED  

getIconPlus

String getIconPlus()
Returns the Icon to use when the given tree node is in an closed state. Default: jsx3.gui.Tree.ICONPLUS

Returns:

URL for icon to use  

getKeyListener

int getKeyListener()
Deprecated. Key navigation now works with sorted trees.
Returns whether or not the tree will listen for key events. Typically this is set jsx3.Boolean.FALSE when the tree is sorted. Default: jsx3.Boolean.TRUE

Returns:

one of: jsx3.Boolean.TRUE or jsx3.Boolean.FALSE 

getMultiSelect

int getMultiSelect()
Returns whether this tree is multi- (Tree.MULTI) or single-select (Tree.SINGLE).

Returns:

 

Since:

3.1

See Also:

MULTI, SINGLE

getNoDataMessage

String getNoDataMessage()
Returns the text/HTML to display on-screen when the xml/xsl transformation for this object results in a null or empty result set

Returns:

text/HTML  

getRoot

int getRoot()
Returns whether or not the tree should paint its root node or paint the direct child nodes to the VIEW without rendering their containing root. Default: jsx3.Boolean.TRUE

Returns:

one of jsx3.Boolean.TRUE or jsx3.Boolean.FALSE  

getText

String getText()
Deprecated.
if 'getValue()' returns a non-null, this method will return the corresponding jsxtext property in the CDF

Returns:

text or null 

Overrides:

getText in jsx3.gui.Block

getValue

String | Array<String> getValue()
Returns the jsxid attribute for the selected CDF record/records.

Returns:

if single-select the jsxid of the selected record or null if none selected; if multi-select an array of the selected record ids.  

Overrides:

getValue in jsx3.gui.Form

getVersion

static String getVersion()
Deprecated.
Returns the release/build for the class (i.e., "2.2.00")

Returns:

 

getXSL

jsx3.xml.Document getXSL()
Returns XSLT for the Tree, prioritizing the acquisition in the following order: 1) check cache; 2) check jsxxsl; 3) check jsxxslurl; 4) use default

Returns:

jsx3.xml.Document instance containing valid XSL stylesheet  

Overrides:

getXSL in jsx3.xml.Cacheable

paint

String paint()
Returns the DHTML, used for this object's on-screen VIEW

Returns:

DHTML  

Overrides:

paint in jsx3.gui.Block

redrawRecord

jsx3.gui.Tree redrawRecord(strRecordId : String, ACTION : int)
if @strRecordId equals the id of the selected option (this.getValue()), only the text property will update; returns a ref to self to facilitate method chaining

Parameters:

strRecordIdid for the record that will be 'redrawn' on-screen
ACTIONOne of the following two values: jsx3.xml.CDF.INSERT, jsx3.xml.CDF.DELETE

Returns:

this object  

Overrides:

redrawRecord in jsx3.xml.CDF

revealRecord

void revealRecord(strRecordId : String, objJSX : jsx3.gui.Block)
Reveals a record by toggling parent nodes as necessary and scrolling any containing blocks within the tree.

Parameters:

strRecordIdthe id of the record to reveal
objJSXif provided, reveal the record up to this visual block; useful if the tree is set to overflow:expand and the containing block is set to overflow:scroll.

setIcon

jsx3.gui.Tree setIcon(strURL : String)
Sets the Icon to use for items in the tree; returns a ref to self

Parameters:

strURLURL for icon to use

Returns:

this object  

setIconMinus

jsx3.gui.Tree setIconMinus(strURL : String)
Sets the Icon to use when a node is in an open state.

Parameters:

strURLURL for icon to use when given tree node is toggled to closed; if null, value is reset to use URL referenced by jsx3.gui.Tree.ICONBOOKCLOSED

Returns:

this object  

setIconPlus

jsx3.gui.Tree setIconPlus(strURL : String)
Sets the Icon to use when the given tree node is in an closed state

Parameters:

strURLURL for icon to use when given tree node is toggled to open; if null, value is reset to use URL referenced by jsx3.gui.Tree.ICONBOOKOPEN

Returns:

this object  

setKeyListener

jsx3.gui.Tree setKeyListener(bBoolean : int)
Deprecated. Key navigation now works with sorted trees.
Sets whether or not the tree will listen for key events. Typically this is set jsx3.Boolean.FALSE when the tree is sorted

Parameters:

bBooleanone of: jsx3.Boolean.TRUE or jsx3.Boolean.FALSE

Returns:

this object 

setMultiSelv class="indent"> 

Since:

3.1

See Also:

MULTI, SINGLE

getNoDataMessage

String getNoDataMessage()
Returns the text/HTML to display on-screen when the xml/xsl transformation for this object results in a null or empty result set

Returns:

text/HTML  

getRoot

int getRoot()
Returns whether or not the tree should paint its root node or paint the direct child nodes to the VIEW without rendering their containing root. Default: jsx3.Boolean.TRUE

Returns:

one of jsx3.Boolean.TRUE or jsx3.Boolean.FALSE  

getText

String getText()
Deprecated.
if 'getValue()' returns a non-null, this method will return the corresponding jsxtext property in the CDF

Returns:

text or null 

Overrides:

getText in jsx3.gui.Block

getValue

String | Array<String> getValue()
Returns the jsxid attribute for the selected CDF record/records.

Returns:

if single-select the jsxid of the selected record or null if none selected; if multi-select an array of the selected record ids.  

Overrides:

getValue in jsx3.gui.Form

getVersion

static String getVersion()
Deprecated.
Returns the release/build for the class (i.e., "2.2.00")

Returns:

 

getXSL

jsx3.xml.Document getXSL()
Returns XSLT for the Tree, prioritizing the acquisition in the following order: 1) check cache; 2) check jsxxsl; 3) check jsxxslurl; 4) use default

Returns:

jsx3.xml.Document instance containing valid XSL stylesheet  

Overrides:

getXSL in jsx3.xml.Cacheable

paint

String paint()
Returns the DHTML, used for this object's on-screen VIEW

Returns:

DHTML  

Overrides:

paint in jsx3.gui.Block

redrawRecord

jsx3.gui.Tree redrawRecord(strRecordId : String, ACTION : int)
if @strRecordId equals the id of the selected option (this.getValue()), only the text property will update; returns a ref to self to facilitate method chaining

Parameters:

strRecordIdid for the record that will be 'redrawn' on-screen
ACTIONOne of the following two values: jsx3.xml.CDF.INSERT, jsx3.xml.CDF.DELETE

Returns:

this object  

Overrides:

redrawRecord in jsx3.xml.CDF

revealRecord

void revealRecord(strRecordId : String, objJSX : jsx3.gui.Block)
Reveals a record by toggling parent nodes as necessary and scrolling any containing blocks within the tree.

Parameters:

strRecordIdthe id of the record to reveal
objJSXif provided, reveal the record up to this visual block; useful if the tree is set to overflow:expand and the containing block is set to overflow:scroll.

setIcon

jsx3.gui.Tree setIcon(strURL : String)
Sets the Icon to use for items in the tree; returns a ref to self

Parameters:

strURLURL for icon to use

Returns:

this object  

setIconMinus

jsx3.gui.Tree setIconMinus(strURL : String)
Sets the Icon to use when a node is in an open state.

Parameters:

strURLURL for icon to use when given tree node is toggled to closed; if null, value is reset to use URL referenced by jsx3.gui.Tree.ICONBOOKCLOSED

Returns:

this object  

setIconPlus

jsx3.gui.Tree setIconPlus(strURL : String)
Sets the Icon to use when the given tree node is in an closed state

Parameters:

strURLURL for icon to use when given tree node is toggled to open; if null, value is reset to use URL referenced by jsx3.gui.Tree.ICONBOOKOPEN

Returns:

this object  

setKeyListener

jsx3.gui.Tree setKeyListener(bBoolean : int)
Deprecated. Key navigation now works with sorted trees.
Sets whether or not the tree will listen for key events. Typically this is set jsx3.Boolean.FALSE when the tree is sorted

Parameters:

bBooleanone of: jsx3.Boolean.TRUE or jsx3.Boolean.FALSE

Returns:

this object 

setMultiSelect

jsx3.gui.Tree setMultiSelect(intMulti : int)
Sets whether this tree is multi- (Tree.MULTI) or single-select (Tree.SINGLE).

Parameters:

intMultiTree.MULTI or Tree.SINGLE

Returns:

this object 

Since:

3.1

See Also:

MULTI, SINGLE

setRoot

jsx3.gui.Tree setRoot(bBoolean : int)
Sets whether or not the tree should paint its root node or paint the direct child nodes to the VIEW without rendering their containing root;

Parameters:

bBooleanone of jsx3.Boolean.TRUE or jsx3.Boolean.FALSE

Returns:

this object  

setValue

jsx3.gui.Tree setValue(strRecordId : String | Array<String>, bReveal : boolean)
Selects a record in the tree. This method updates the model, datamodel, and view.

Parameters:

strRecordIdid for the record that will be the selected item, may be null to deselect all records
bReveal

Returns:

this object  

Overrides:

setValue in jsx3.gui.Form

toggleItem

jsx3.gui.Tree toggleItem(strRecordId : String, bOpen : boolean, bBook : boolean)
toggles the open/closed state for a node on the tree; updates both MODEL and VIEW; if the tree is not yet painted and the open state for a node needs to be set, call: [tree instance].insertRecordProperty(@strId,@strPropName,@strPropValue,false); if there is a VIEW for the item, the 'ontoggle' event will be fired; if the developer has bound an ontoggle script (e.g., [treeinstance].setEvent("var a=1;",jsx3.gui.Interactive.TOGGLE);), this script will have contextual access to the variables: objGUI: object reference to the on-screen DHTML object for the node just toggled; objRECORD: object reference for the node in the XML Cache; strID: The jsxid property(as a string) for the node object; bOPEN: whether to item was toggled open (true) or closed (false). Returns a reference to self to facilitate method chaining

Parameters:

strRecordIdunique id for the given record (the 'jsxid' attribute on the given record node)
bOpenif null, the open state wilass="param">bOpenif null, the open state will be toggled; otherwise, true will expand the node to display its childre; false, vice versa
bBookfalse if null; if true, the system wants to force the VIEW to make the item a book

Returns:

this object