class Tree
All Implemented Interfaces:
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:
-
jsxid
-
jsxselected
-
jsxstyle
-
jsxclass
-
jsxopen
-
jsximg
-
jsxlazy (see model event DATA)
-
jsxtip
-
jsxtext
-
jsxunselectable
This class publishes the following model events:
-
DATA –
-
EXECUTE –
-
SELECT (deprecated) –
-
MENU –
-
TOGGLE –
-
CHANGE –
-
SPYGLASS –
-
ADOPT –
-
DROP/CTRL_DROP/BEFORE_DROP/CANCEL_DROP –
| Field Summary |
|---|
| static String | jsx:///images/matrix/append.gif
|
| static String | Deprecated. Use CSS instead.
|
| static String | #ffffff (default)
|
| static String | (default)
|
| static String | |
| static String | |
| static String | JSX/images/tree/file.gif (default)
|
| static String | JSX/images/tree/minus.gif (default)
|
| static String | JSX/images/tree/plus.gif (default)
|
| static String | jsx:///images/matrix/insert_before.gif
|
| static int | Enum value for the multiSelect property indicating a multi-select tree. |
| static String | |
| static String | JSX/images/tree/select.gif (default)
|
| static int | Enum value for the multiSelect property indicating a single-select tree. |
| Constructor Summary |
|---|
| void | instance initializer |
| Method Summary |
|---|
| int | validates the Tree; if the Tree is set to 'required', a selection must be made to pass validation. |
| void | 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 | |
| String | Array<String> | Returns the jsxid attribute for the selected CDF record/records. |
| static String | |
| 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 | 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 | Reveals a record by toggling parent nodes as necessary and scrolling any containing blocks within the tree. |
| jsx3.gui.Tree | Sets the Icon to use for items in the tree; returns a ref to self |
| jsx3.gui.Tree | Sets the Icon to use when a node is in an open state. |
| jsx3.gui.Tree | Sets the Icon to use when the given tree node is in an closed state |
| jsx3.gui.Tree | Deprecated. Key navigation now works with sorted trees.
|
| jsx3.gui.Tree | Sets whether this tree is multi- (Tree.MULTI) or single-select (Tree.SINGLE). |
| jsx3.gui.Tree | 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 | Selects a record in the tree. |
| jsx3.gui.Tree | 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, getRecordIds, getRecordNode, getSchema, insertRecord, insertRecordBefore, insertRecordNode, insertRecordProperty, reloadFromSource, setSchema |
| Methods Inherited From jsx3.gui.Block |
|---|
| getBackground, getBackgroundColor, getBorder, getCDFAttribute, getCDFId, 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, setCDFAttribute, setCDFId, 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, getRendered, insertHTML, onAfterPaint, onAfterRestoreView, paintChild, paintChildren, recalcBox, removeAttribute, removeAttributes, repaint, setAttribute |
| Methods Inherited From jsx3.app.Model |
|---|
| adoptChild, assembleFromXML, doClone, findAncestor, findDescendants, getAncestorOfName, getAncestorOfType, getChild, getChildIndex, getChildren, getDescendantOfName, getDescendantsOfType, getDynamicProperty, getFirstChild, getFirstChildOfType, getHelpId, getId, getLastChild, getLoadType, getMetaValue, getNS, getName, getNextSibling, getParent, getPersistence, getPreviousSibling, getServer, getUriResolver, insertBefore, load, loadAndCache, loadXML, onAfterAssemble, onAfterAttach, onBeforeAssemble, onChangeServer, onChildAdded, onDestroy, onRemoveChild, onSetChild, onSetParent, removeChild, removeChildren, selectDescendants, setChild, setDynamicProperty, setHelpId, setLoadType, setMetaValue, setName, setPersistence, toString, toXML, toXMLDoc, toXMLElm |
| Methods Inherited From jsx3.lang.Object |
|---|
| clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf |
jsx:///images/matrix/append.gif
Deprecated. Use CSS instead.
#8CAEDF (default)
static
String DEFAULTBACKGROUNDCOLOR
static
String DEFAULTNODATAMSG
Deprecated.
JSX_TREE_XSL (default)
JSX/images/tree/file.gif (default)
JSX/images/tree/minus.gif (default)
JSX/images/tree/plus.gif (default)
static
String INSERT_BEFORE_IMG
jsx:///images/matrix/insert_before.gif
Enum value for the multiSelect property indicating a multi-select tree.
Deprecated.
url(JSX/images/tree/over.gif) (default)
JSX/images/tree/select.gif (default)
Enum value for the multiSelect property indicating a single-select tree.
instance initializer
Parameters:
strName – unique name distinguishing this object from all other JSX GUI objects in the JSX application
strId – this value should correspond to the jsxid for the 'record' node is the selected node for the tree
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:
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:
strRecordId – jsxid value for the record node (according to the CDF) to execute
Returns the Icon to use for items in the tree. Default: jsx3.gui.Tree.ICON
Returns:
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
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
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
Returns whether this tree is multi- (Tree.MULTI) or single-select (Tree.SINGLE).
Returns:
Since:
3.1
See Also:
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
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
Deprecated.
if 'getValue()' returns a non-null, this method will return the corresponding jsxtext property in the CDF
Returns:
text or null
Overrides:
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:
Deprecated.
Returns the release/build for the class (i.e., "2.2.00")
Returns:
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:
Returns the DHTML, used for this object's on-screen VIEW
Returns:
DHTML
Overrides:
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:
strRecordId – id for the record that will be 'redrawn' on-screen
ACTION – One of the following two values: jsx3.xml.CDF.INSERT, jsx3.xml.CDF.DELETE
Returns:
this object
Overrides:
Reveals a record by toggling parent nodes as necessary and scrolling any containing blocks within the tree.
Parameters:
strRecordId – the id of the record to reveal
objJSX – if 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.
Sets the Icon to use for items in the tree; returns a ref to self
Parameters:
strURL – URL for icon to use
Returns:
this object
Sets the Icon to use when a node is in an open state.
Parameters:
strURL – 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
Returns:
this object
Sets the Icon to use when the given tree node is in an closed state
Parameters:
strURL – URL 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
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:
bBoolean – one of: jsx3.Boolean.TRUE or jsx3.Boolean.FALSE
Returns:
this object
Sets whether this tree is multi- (Tree.MULTI) or single-select (Tree.SINGLE).
Parameters:
intMulti – Tree.MULTI or Tree.SINGLE
Returns:
this object
Since:
3.1
See Also:
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:
bBoolean – one of jsx3.Boolean.TRUE or jsx3.Boolean.FALSE
Returns:
this object
Selects a record in the tree. This method updates the model, datamodel, and view.
Parameters:
strRecordId – id for the record that will be the selected item, may be null to deselect all records
bReveal –
Returns:
this object
Overrides:
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:
strRecordId – unique id for the given record (the 'jsxid' attribute on the given record node)
bOpen – if null, the open state will be toggled; otherwise, true will expand the node to display its childre; false, vice versa
Returns:
this object
Copyright © 2001-2011, TIBCO Software Inc.