OverviewSingleDeprecated

jsx3.app

class Model

Object
->jsx3.lang.Object
  ->jsx3.app.Model

All Implemented Interfaces:

jsx3.util.EventDispatcher

Direct Known Subclasses:

jsx3.gui.Painted, jsx3.gui.Window

abstract class Model
extends jsx3.lang.Object
The abstract base class that defines the JSX DOM. Instances of this class exist as nodes in a tree, each with a single parent and multiple children. This class includes all the methods for querying and manipulating the DOM's tree structure, such as getChild(), adoptChild(), getParent(), etc.

Field Summary
static int
ASYNC_LOAD_TIMEOUT
The number of milliseconds before asynchronous component loads time out.
static String
CIF_VERSION
Minimum supported version CIF formatted serialization files
static String
CURRENT_VERSION
Minimum supported version for serialization files
static int
LT_NORMAL
The normal load type for a DOM branch.
static int
LT_SHOW_DESER
Load type indicating that the DOM branch will deserialize and paint as needed when it becomes visible.
static int
LT_SHOW_PAINT
Load type indicating that the DOM branch will paint as needed when it becomes visible.
static int
LT_SLEEP_DESER
Load type indicating that the DOM branch will deserialize and paint after its parent deserializes and the call stack resets.
static int
LT_SLEEP_PAINT
Load type indicating that the DOM branch will paint after its parent paints and the call stack resets.
static int
LT_SLEEP_PD
Load type indicating that the DOM branch will deserialize after its parent deserializes and the call stack resets and will paint after its parent paints and the call stack resets.
static Object<String, boolean>
META_FIELDS
The allowed meta data fields.
static int
PERSISTEMBED
Normal persistance value for a child that will be persisted.
static int
PERSISTNONE
Persistance value fora child that is temporarily part of the DOM tree and will not be persisted.
static int
PERSISTREF
Persistance value for a child that exists in an external serialization file and is referenced by URI.
static int
PERSISTREFASYNC
Persistance value for a child that exists in an external serialization file and is referenced by URI.
Constructor Summary
void
init(strName : String, strInstanceOf : ?)
The instance initializer.
Method Summary
void
adoptChild(objChild : jsx3.app.Model, bRepaint : boolean, bForce : boolean)
Appends a DOM node to this object after removing the node from its former parent reference.
jsx3.app.Model
doClone(intPersist : int, intMode : int)
Creates and returns an exact replica of the object.
jsx3.app.Model
findAncestor(fctTest : Function, bIncludeSelf : boolean)
Returns the first ancestor passing the given test function.
jsx3.app.Model | Array<jsx3.app.Model>
findDescendants(fctTest : Function, bDepthFirst : boolean, bMultiple : boolean, bShallow : boolean, bIncludeSelf : boolean)
Finds all DOM nodes descending from this DOM node that pass the given test function.
jsx3.app.Model
Returns the first ancestor with the given name.
jsx3.app.Model
Returns the first ancestor of the given type.
jsx3.app.Model
getChild(vntIndexOrName : int | String)
Returns the child DOM node of this node at the given index or with the given name.
int
Returns the zero-based index for this DOM node in relation to its siblings.
Array<jsx3.app.Model>
Returns an array containing all the child DOM nodes of this object.
jsx3.app.Model
getDescendantOfName(strName : String, bDepthFirst : boolean, bChildOnly : boolean)
Finds the first descendant of this DOM node with a the given name.
Array<jsx3.app.Model>
Finds all descendants of the given type.
jsx3.app.Model
Returns the first child.
jsx3.app.Model
Finds the first child of the given type.
String
Returns the help ID of this object.
String
Returns the custom JSX-generated id for the object (i.e.
jsx3.app.Model
Returns the last child.
int
Returns the load type of this DOM node and the descending branch.
String
getMetaValue(strKey : String)
Returns one of the meta data values stored at the top of the serialization file that this object was loaded from.
String
Returns the namespace that distinguishes this object's server (owner) from other server instances.
String
Returns the custom developer-defined name of this object.
jsx3.app.Model
Returns the next sibling.
jsx3.app.Model
Returns the parent DOM node of this object.
int
Returns the persistence bit for this model object.
jsx3.app.Model
Returns the previous sibling.
jsx3.app.Server
Returns an object reference to the server that owns this object.
jsx3.net.URIResolver
Returns the URI resolver for this DOM node.
static String
Deprecated.
boolean
insertBefore(objMoveChild : jsx3.app.Model, objPrecedeChild : jsx3.app.Model, bRepaint : boolean)
Assigns objMoveChild as the previousSibling of objPrecedeChild
jsx3.app.Model
load(strURL : String | jsx3.net.URI, bRepaint : boolean, objResolver : jsx3.net.URIResolver)
Deserializes a JSX serialization file and appends the deserialized objects as children of this DOM node.
void
loadAndCache(strURL : String | jsx3.net.URI, bRepaint : boolean, objCache : jsx3.app.Cache, objResolver : jsx3.net.URIResolver)
Loads a component file and caches the document in an XML cache.
jsx3.app.Model
loadXML(strXML : String | jsx3.xml.Document, bRepaint : boolean, objResolver : jsx3.net.URIResolver)
Deserializes a JSX serialization file and appends the deserialized objects as children of this DOM node.
protected void
onAfterAssemble(objParent : jsx3.app.Model, objServer : jsx3.app.Server)
Called during deserialization of this object.
protected void
Called during deserialization of this object.
protected void
onBeforeAssemble(objParent : jsx3.app.Model, objServer : jsx3.app.Server)
Called during deserialization of this object.
protected void
onChangeServer(objNewServer : jsx3.app.Server, objOldServer : jsx3.app.Server)
Called when the server owning this DOM node changes.
protected void
onDestroy(objParent : jsx3.app.Model)
The finalizer method.
protected void
onRemoveChild(objChild : jsx3.app.Model | Array<jsx3.app.Model>, intIndex : int)
Hook that notifies this model object that one of its children has been removed.
protected boolean
onSetChild(objChild : ?)
Hook that allows for a prospective parent DOM node to veto the adoption of a child.
protected boolean
onSetParent(objParent : ?)
Hook that allows for a prospective child DOM node to veto its adoption by a parent.
jsx3.app.Model
Removes a DOM child from this object.
jsx3.app.Model
Removes some or all children of this object.
jsx3.app.Model | boolean
setChild(objChild : jsx3.app.Model, intPersist : int, strSourceURL : String | jsx3.net.URI, strNS : String)
Appends a child DOM node to this parent DOM node.
void
setHelpId(strId : String)
Sets the help ID of this object.
void
setLoadType(intLoadType : int)
Sets the load type of this DOM node and the descending branch.
void
setMetaValue(strKey : String, strValue : String)
setS one of the meta data values stored at the top of a component's serialization file.
void
setName(strName : String)
Sets the custom developer-defined name of this object.
jsx3.app.Model
setPersistence(intPersist : int)
Sets the persistence bit for this model object.
String
Returns a string representation of this object.
String
toXML(objProperties : Object<String, String>)
Returns this object serialized as XML by calling toString() on the result of toXMLDoc() called on this object.
jsx3.xml.Document
toXMLDoc(objProperties : Object<String, String>)
Serializes this object as an XML document.
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

ASYNC_LOAD_TIMEOUT

static int ASYNC_LOAD_TIMEOUT
The number of milliseconds before asynchronous component loads time out.

CIF_VERSION

static String CIF_VERSION
Minimum supported version CIF formatted serialization files

CURRENT_VERSION

static String CURRENT_VERSION
Minimum supported version for serialization files

LT_NORMAL

static final int LT_NORMAL
The normal load type for a DOM branch. The DOM branch deserializes and paints with its parent.

LT_SHOW_DESER

static final int LT_SHOW_DESER
Load type indicating that the DOM branch will deserialize and paint as needed when it becomes visible. It is left to subclasses of Model to implement this functionality.

LT_SHOW_PAINT

static final int LT_SHOW_PAINT
Load type indicating that the DOM branch will paint as needed when it becomes visible. It is left to subclasses of Model to implement this functionality.

LT_SLEEP_DESER

static final int LT_SLEEP_DESER
Load type indicating that the DOM branch will deserialize and paint after its parent deserializes and the call stack resets.

LT_SLEEP_PAINT

static final int LT_SLEEP_PAINT
Load type indicating that the DOM branch will paint after its parent paints and the call stack resets.

LT_SLEEP_PD

static final int LT_SLEEP_PD
Load type indicating that the DOM branch will deserialize after its parent deserializes and the call stack resets and will paint after its parent paints and the call stack resets.

META_FIELDS

static Object<String, boolean> META_FIELDS
The allowed meta data fields. See getMetaValue() and setMetaValue().

PERSISTEMBED

static final int PERSISTEMBED
Normal persistance value for a child that will be persisted.

PERSISTNONE

static final int PERSISTNONE
Persistance value fora child that is temporarily part of the DOM tree and will not be persisted.

PERSISTREF

static final int PERSISTREF
Persistance value for a child that exists in an external serialization file and is referenced by URI.

PERSISTREFASYNC

static final int PERSISTREFASYNC
Persistance value for a child that exists in an external serialization file and is referenced by URI. The loading of a child with this persistence value will happen asynchronously after the file that references it is loaded.
Constructor Detail

init

void init(strName : String, strInstanceOf : ?)
The instance initializer.

Parameters:

strNamea unique name distinguishing this object from all other JSX GUI objects in the JSX application
strInstanceOf
Method Detail

adoptChild

void adoptChild(objChild : jsx3.app.Model, bRepaint : boolean, bForce : boolean)
Appends a DOM node to this object after removing the node from its former parent reference. If the node to append does not already have a DOM parent, setChild() should be used instead of this method.

Parameters:

objChildthe child to adopt
bRepaintif true or null, the object being adopted will be added to the parent's view via the parent's paintChild() method. This parameter is made available for those situations where a loop is executing and multiple objects are being adopted. As view operations are the most CPU intensive, passing false while looping through a collection of child objects to adopt will improve performance. After the last child is adopted, simply call repaint() on the parent to immediately synchronize the view.
bForceif true, the adoption is forced, even if the parent/child don't accept such adoptions (onSetChild() and onSetParent() will still be called)

See Also:

setChild()

doClone

jsx3.app.Model doClone(intPersist : int, intMode : int)
Creates and returns an exact replica of the object. The clone will be appended as a new child node of this object's parent node.

Parameters:

intPersistthe persistance value of the clone.
intMode0 for insert as the last child of the parent of this object and paint, 1 for insert as the last child of this parent of this object and do not paint, or 2 for load as a fragment.

Throws:

{jsx3.lang.Exception}if this object has no parent DOM node.

Returns:

the clone. 

findAncestor

jsx3.app.Model findAncestor(fctTest : Function, bIncludeSelf : boolean)
Returns the first ancestor passing the given test function.

Parameters:

fctTesttest function, takes a single jsx3.app.Model parameter and returns true if the node matches.
bIncludeSelfif true, include this object in the search

Returns:

 

findDescendants

jsx3.app.Model | Array<jsx3.app.Model> findDescendants(fctTest : Function, bDepthFirst : boolean, bMultiple : boolean, bShallow : boolean, bIncludeSelf : boolean)
Finds all DOM nodes descending from this DOM node that pass the given test function. Results are guaranteed to be returned in order according to the search order used.

Parameters:

fctTesttest function, takes a single jsx3.app.Model parameter and returns true if the node matches.
bDepthFirstspecifies whether to do a depth first or breadth first search.
bMultipleif true, return an array of matches, otherwise just the first match.
bShallowif true, only search direct children.
bIncludeSelfif true, include this node in the search.

Returns:

the match (bMultiple = false) or matches (bMultiple = true).  

getAncestorOfName

jsx3.app.Model getAncestorOfName(strName : String)
Returns the first ancestor with the given name.

Parameters:

strNamethe name to query on.

Returns:

the first ancestor with the given name or null if none found.  

getAncestorOfType

jsx3.app.Model getAncestorOfType(strType : String | Function | jsx3.lang.Class)
Returns the first ancestor of the given type.

Parameters:

strTypethe fully-qualified class name, class constructor function, or jsx3.Class instance.

Returns:

the first ancestor of the given type or null if none found.  

getChild

jsx3.app.Model getChild(vntIndexOrName : int | String)
Returns the child DOM node of this node at the given index or with the given name. If a name is supplied, the children are searched in order and the first matching child is returned.

Parameters:

vntIndexOrNameeither the integer index or the string name of the child.

Returns:

the child at the given index or with the given name, or null if no such child exists.  

getChildIndex

int getChildIndex()
Returns the zero-based index for this DOM node in relation to its siblings.

Returns:

the index or -1 if this object does not have a parent.  

getChildren

Array<jsx3.app.Model> getChildren()
Returns an array containing all the child DOM nodes of this object. The return value is the original array rather than a copy and should not be modified.

Returns:

 

getDescendantOfName

jsx3.app.Model getDescendantOfName(strName : String, bDepthFirst : boolean, bChildOnly : boolean)
Finds the first descendant of this DOM node with a the given name.

Parameters:

strNamethe name to query on.
bDepthFirstspecifies whether to do a depth first or breadth first search.
bChildOnlyif true, only search the children of this DOM node.

Returns:

the descendant with the given name or null if none found.  

getDescendantsOfType

Array<jsx3.app.Model> getDescendantsOfType(strType : String | Function | jsx3.lang.Class, bShallow : boolean)
Finds all descendants of the given type.

Parameters:

strTypethe fully-qualified class name, class constructor function, or jsx3.Class instance.
bShallowif true, only search direct children, not all descendants.

Returns:

an array of matching descendants  

getFirstChild

jsx3.app.Model getFirstChild()
Returns the first child.

Returns:

 

getFirstChildOfType

jsx3.app.Model getFirstChildOfType(strType : String | Function | jsx3.lang.Class, bExact : boolean)
Finds the first child of the given type.

Parameters:

strTypethe fully-qualified class name, class constructor function, or jsx3.Class instance.
bExactif true then only return objects whose class is exactly strType (rather than returning subclasses too).

Returns:

the child of the given type or null if none found.  

getHelpId

String getHelpId()
Returns the help ID of this object.

Returns:

 

Since:

3.5

See Also:

jsx3.app.Server.HELP

getId

String getId()
Returns the custom JSX-generated id for the object (i.e., _jsx2384098324509823049).

Returns:

JSX id  

getLastChild

jsx3.app.Model getLastChild()
Returns the last child.

Returns:

 

getLoadType

int getLoadType()
Returns the load type of this DOM node and the descending branch. The load type determines how this DOM branch deserializes and paints in relation to its parent DOM node.

Returns:

LT_NORMAL, LT_SLEEP_PAINT, LT_SLEEP_DESER, LT_SLEEP_PD, LT_SHOW_PAINT, or LT_SHOW_DESER

Since:

3.5

See Also:

LT_NORMAL, LT_SLEEP_PAINT, LT_SLEEP_DESER, LT_SLEEP_PD, LT_SHOW_PAINT, LT_SHOW_DESER

getMetaValue

String getMetaValue(strKey : String)
Returns one of the meta data values stored at the top of the serialization file that this object was loaded from.

Parameters:

strKeythe name of the meta data field, one of the keys in META_FIELDS.

Returns:

the meta data value or empty string. 

See Also:

META_FIELDS

getNS

String getNS()
Returns the namespace that distinguishes this object's server (owner) from other server instances. The namespace is set when this object is bound to a DOM tree.

Returns:

the namespace of the server that owns this object instance.  

getName

String getName()
Returns the custom developer-defined name of this object.

Returns:

 

getNextSibling

jsx3.app.Model getNextSibling()
Returns the next sibling.

Returns:

 

getParent

final jsx3.app.Model getParent()
Returns the parent DOM node of this object.

Returns:

 

getPersistence

int getPersistence()
Returns the persistence bit for this model object.

Returns:

one of PERSISTNONE, PERSISTEMBED, PERSISTREF, PERSISTREFASYNC

See Also:

PERSISTNONE, PERSISTEMBED, PERSISTREF, PERSISTREFASYNC

getPreviousSibling

jsx3.app.Modep.Model getDescendantOfName(strName : String, bDepthFirst : boolean, bChildOnly : boolean)
Finds the first descendant of this DOM node with a the given name.

Parameters:

strNamethe name to query on.
bDepthFirstspecifies whether to do a depth first or breadth first search.
bChildOnlyif true, only search the children of this DOM node.

Returns:

the descendant with the given name or null if none found.  

getDescendantsOfType

Array<jsx3.app.Model> getDescendantsOfType(strType : String | Function | jsx3.lang.Class, bShallow : boolean)
Finds all descendants of the given type.

Parameters:

strTypethe fully-qualified class name, class constructor function, or jsx3.Class instance.
bShallowif true, only search direct children, not all descendants.

Returns:

an array of matching descendants  

getFirstChild

jsx3.app.Model getFirstChild()
Returns the first child.

Returns:

 

getFirstChildOfType

jsx3.app.Model getFirstChildOfType(strType : String | Function | jsx3.lang.Class, bExact : boolean)
Finds the first child of the given type.

Parameters:

strTypethe fully-qualified class name, class constructor function, or jsx3.Class instance.
bExactif true then only return objects whose class is exactly strType (rather than returning subclasses too).

Returns:

the child of the given type or null if none found.  

getHelpId

String getHelpId()
Returns the help ID of this object.

Returns:

 

Since:

3.5

See Also:

jsx3.app.Server.HELP

getId

String getId()
Returns the custom JSX-generated id for the object (i.e., _jsx2384098324509823049).

Returns:

JSX id  

getLastChild

jsx3.app.Model getLastChild()
Returns the last child.

Returns:

 

getLoadType

int getLoadType()
Returns the load type of this DOM node and the descending branch. The load type determines how this DOM branch deserializes and paints in relation to its parent DOM node.

Returns:

LT_NORMAL, LT_SLEEP_PAINT, LT_SLEEP_DESER, LT_SLEEP_PD, LT_SHOW_PAINT, or LT_SHOW_DESER

Since:

3.5

See Also:

LT_NORMAL, LT_SLEEP_PAINT, LT_SLEEP_DESER, LT_SLEEP_PD, LT_SHOW_PAINT, LT_SHOW_DESER

getMetaValue

String getMetaValue(strKey : String)
Returns one of the meta data values stored at the top of the serialization file that this object was loaded from.

Parameters:

strKeythe name of the meta data field, one of the keys in META_FIELDS.

Returns:

the meta data value or empty string. 

See Also:

META_FIELDS

getNS

String getNS()
Returns the namespace that distinguishes this object's server (owner) from other server instances. The namespace is set when this object is bound to a DOM tree.

Returns:

the namespace of the server that owns this object instance.  

getName

String getName()
Returns the custom developer-defined name of this object.

Returns:

 

getNextSibling

jsx3.app.Model getNextSibling()
Returns the next sibling.

Returns:

 

getParent

final jsx3.app.Model getParent()
Returns the parent DOM node of this object.

Returns:

 

getPersistence

int getPersistence()
Returns the persistence bit for this model object.

Returns:

one of PERSISTNONE, PERSISTEMBED, PERSISTREF, PERSISTREFASYNC

See Also:

PERSISTNONE, See Also:

getPreviousSibling

jsx3.app.Model getPreviousSibling()
Returns the previous sibling.

Returns:

 

getServer

jsx3.app.Server getServer()
Returns an object reference to the server that owns this object. This method returns null if this object is part of a DOM fragment. Until an object is added to a DOM tree by passing it as the parameter to setChild(), the object will be a DOM fragment.

Returns:

 

getUriResolver

jsx3.net.URIResolver getUriResolver()
Returns the URI resolver for this DOM node. This method returns the server of this object unless this node or its ancestor was loaded into the DOM with an explicit URI resolver.

Returns:

 

getVersion

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

Returns:

 

insertBefore

boolean insertBefore(objMoveChild : jsx3.app.Model, objPrecedeChild : jsx3.app.Model, bRepaint : boolean)
Assigns objMoveChild as the previousSibling of objPrecedeChild

Parameters:

objMoveChildthe one being moved. Can belong to this object, another object, or can be a GUI fragment
objPrecedeChildthe one to insert before
bRepaintif false the repaint will be suppressed (useful for multiple obejct updates that would lead to unnecessary updates to the VIEW)

Returns:

true if successful  

load

jsx3.app.Model load(strURL : String | jsx3.net.URI, bRepaint : boolean, objResolver : jsx3.net.URIResolver)
Deserializes a JSX serialization file and appends the deserialized objects as children of this DOM node.

Parameters:

strURLURL (either relative or absolute) of the serialization file to deserialize. This URL is resolved relative to objResolver, if provided, or the URI resolver of this DOM node.
bRepaintif true or null the deserialized objects will be added to the parent's view via the parent object's paintChild() method.
objResolverIf this parameter is provided, strURL is resolved relative to it. Additionally, this resolver is stored as the URI resolver for this DOM node and its descendants.

Throws:

{jsx3.lang.Exception}if strURL is not the URL of a valid XML document.

Returns:

the deserialized object. A serialization file may specify more than one root object, in which case this method returns the first deserialized object. 

See Also:


loadAndCache

void loadAndCache(strURL : String | jsx3.net.URI, bRepaint : boolean, objCache : jsx3.app.Cache, objResolver : jsx3.net.URIResolver)
Loads a component file and caches the document in an XML cache. If the component file already exists in the cache then it is loaded from the cache. All component files loaded as a result of this call (referenced files) are also cached. This method is a useful replacement for load() when the same URL will be loaded multiple times in one application.

Parameters:

strURLURL (either relative or absolute) of the serialization file to deserialize. This URL is resolved relative to objResolver, if provided, or the URI resolver of this DOM node.
bRepaintif true or null the deserialized objects will be added to the parent's view via the parent object's paintChild() method.
objCachethe cache to store the component XML documents in. If not provided, the cache of the server of this model object is used.
objResolverIf this parameter is provided, strURL is resolved relative to it. Additionally, this resolver is stored as the URI resolver for this DOM node and its descendants.

Throws:

{jsx3.lang.Exception}if strURL is not the URL of a valid XML document.

See Also:


loadXML

jsx3.app.Model loadXML(strXML : String | jsx3.xml.Document, bRepaint : boolean, objResolver : jsx3.net.URIResolver)
Deserializes a JSX serialization file and appends the deser

loadXML

jsx3.app.Model loadXML(strXML : String | jsx3.xml.Document, bRepaint : boolean, objResolver : jsx3.net.URIResolver)
Deserializes a JSX serialization file and appends the deserialized objects as children of this DOM node.

Parameters:

strXMLthe XML content of a JSX serialization file.
bRepaintif true or null the deserialized objects will be added to the parent's view via the parent object's paintChild() method.
objResolver

Throws:

{jsx3.lang.Exception}if strXML is not a valid XML document.

Returns:

the deserialized object. A serialization file may specify more than one root object, in which case this method returns the first deserialized object. 

onAfterAssemble

protected void onAfterAssemble(objParent : jsx3.app.Model, objServer : jsx3.app.Server)
Called during deserialization of this object. This method provides a hook for initializing an object during deserialization since init() is not called. Called after this object has been instantiated and after its fields and children have been assembled.This method is called before this object is attached to the DOM, therefore getParent(), getServer(), getXML(), etc. return null.

Parameters:

objParentthe parent of this object once it is attached to the DOM.
objServerthe server that this DOM object will attach to.

onAfterAttach

protected void onAfterAttach()
Called during deserialization of this object. This method provides a hook for initializing an object during deserialization since init() is not called. Called after this object has been instantiated and after it has been attached to the DOM. Methods overriding this method should usually finish with a call to jsxsuper().

When a new branch is attached to the DOM, this method is executed on each node in the branch. The order is reverse-breadth-first meaning that child nodes are notified from oldest to youngest and before the parent node.

This implementation of this method executes the on-after-deserialize script of this object.

onBeforeAssemble

protected void onBeforeAssemble(objParent : jsx3.app.Model, objServer : jsx3.app.Server)
Called during deserialization of this object. This method provides a hook for initializing an object during deserialization since init() is not called. Called after this object has been instantiated but before its fields and children have been assembled. This method is called before this object is attached to the DOM, therefore getParent(), getServer(), getXML(), etc. return null.

Parameters:

objParentthe parent of this object once it is attached to the DOM.
objServerthe server that this DOM object will attach to.

onChangeServer

protected void onChangeServer(objNewServer : jsx3.app.Server, objOldServer : jsx3.app.Server)
Called when the server owning this DOM node changes.

Parameters:

objNewServer
objOldServer

Since:

3.5

onDestroy

protected void onDestroy(objParent : jsx3.app.Model)
The finalizer method. This method provides a hook for subclasses of this class to perform custom logic when an instance of this class is removed from the DOM. Methods that override this method should begin with a call to jsxsuper().

Note that this method is called after this object has been removed from the DOM tree. Therefore this.getParent() and this.getServer() will return null. Use the objParent parameter for access to the DOM tree.

Parameters:

objParentreference to the former parent

onRemoveChild

protected void onRemoveChild(objChild : jsx3.app.Model | Array<jsx3.app.Model>, intIndex : int)
Hook that notifies this model object that one of its children has been removed. This hook exists simply to allow this object to perform cleanup/re-render, and does not provide a veto mechanism. This method is called after the child has been removed from the model (this.getChildren() does not contain objChild) and after the child has been removed from the view (objChild.getRendered() is also null).

This method is only called if the child is being removed from the DOM but this object (the parent) is not being removed. Therefore, this hook cannot be relied upon for garbage collection.

If removeChildren() is called on this object, this hook is called exactly once after all children have been removed. In that case, the first parameter to this method will be the array of children and the second parameter will be null.

In general a method overriding this method should begin by calling jsxsuper.

Parameters:

objChildthe child that was removed
intIndexthe index of the removed child

onSetChild

protected boolean onSetChild(objChild : ?)
Hook that allows for a prospective parent DOM node to veto the adoption of a child.

Parameters:

objChild

Returns:

true to allow the set, false to veto 

onSetParent

protected boolean onSetParent(objParent : ?)
Hook that allows for a prospective child DOM node to veto its adoption by a parent. This method is only called if the prospective parent has not already vetoed the adoption in the onSetChild() method.

Parameters:

objParent

Returns:

true to allow the set, false to veto 

removeChild

jsx3.app.Model removeChild(vntItem : int | jsx3.app.Model)
Removes a DOM child from this object. This method removes the on-screen DHTML of the removed object. The removed child will be completely derefenced from the DOM and will be prepped for garbage collection. If a DOM child must continue to exist after removing it from this parent, adoptChild() should be used instead of this method.

Parameters:

vntItemeither the index of the child to remove or the child itself.

Returns:

this object 

See Also:


removeChildren

jsx3.app.Model removeChildren(arrChildren : Array<int | jsx3.app.Model
vntItemeither the index of the child to remove or the child itself.

Returns:

this object 

See Also:


removeChildren

jsx3.app.Model removeChildren(arrChildren : Array<int | jsx3.app.Model>)
Removes some or all children of this object.

Parameters:

arrChildrenthe children to remove. If this parameter is not provided then all children are removed.

Returns:

this object. 

See Also:


setChild

jsx3.app.Model | boolean setChild(objChild : jsx3.app.Model, intPersist : int, strSourceURL : String | jsx3.net.URI, strNS : String)
Appends a child DOM node to this parent DOM node. If the child already has a parent, adoptChild() should be used instead to ensure that the child is removed from its current parent.

Parameters:

objChildthe root node of a DOM fragment.
intPersistdefines how the child will be persisted/serialized. The valid values are the four persistence values defined as static fields in this class.
strSourceURLthe path to the serialization file where the child exists. This parameter is only relevant if the given intPersist is PERSISTREF or PERSISTREFASYNC.
strNSthe namespace of the child to append. This parameter is normally not required but is useful when sharing DOM nodes between servers with different namespaces.

Throws:

{jsx3.lang.Exception}if this object is part of a DOM fragment (the namespace is null) and the strNS parameter is not specified.

Returns:

this object or false if the set was vetoed 

See Also:


setHelpId

void setHelpId(strId : String)
Sets the help ID of this object.

Parameters:

strId

Since:

3.5

See Also:


setLoadType

void setLoadType(intLoadType : int)
Sets the load type of this DOM node and the descending branch.

Parameters:

intLoadTypeLT_NORMAL, LT_SLEEP_PAINT, LT_SLEEP_DESER, LT_SLEEP_PD, LT_SHOW_PAINT, or LT_SHOW_DESER.

Since:

3.5

See Also:


setMetaValue

void setMetaValue(strKey : String, strValue : String)
setS one of the meta data values stored at the top of a component's serialization file.

Parameters:

strKeythe name of the meta data field, one of the keys in META_FIELDS
strValuethe new value of the meta data field.

See Also:


setName

void setName(strName : String)
Sets the custom developer-defined name of this object.

Parameters:

strNamea name unique among all DOM nodes currently loaded in the application.

setPersistence

jsx3.app.Model setPersistence(intPersist : int)
Sets the persistence bit for this model object.

Parameters:

intPersistone of PERSISTNONE, PERSISTEMBED, PERSISTREF, PERSISTREFASYNC.

Returns:

this object 

See Also:


toString

String toString()
Returns a string representation of this object.

Returns:

 

Overrides:


toXML

String toXML(objProperties : Object<String, String>)
Returns this object serialized as XML by calling toString() on the result of toXMLDoc() called on this object.

Parameters:

objPropertiesname-value pairs that affect the serialization. See toXMLDoc() for a description.

Returns:

this object serialized as an XML string. 

See Also:


toXMLDoc

jsx3.xml.Document toXMLDoc(objProperties : Object<String, String>)
Serializes this object as an XML document.

The objProperties parameter may include the following keys:
  • onafter {String} - the value of the onAfterDeserialize element
  • onbefore {String} - the value of the onBeforeDeserialize element
  • name {String} - the value of the name element
  • icon {String} - the value of the icon element
  • description {String} - the value of the description element
  • children {boolean} - if true the children of this object, rather than this object, are serialized
  • persistall {boolean} - if true all descendants with persistence PERSISTNONE are included in the serialization

Parameters:

objPropertiesname-value pairs that affect the serialization. See above for valid names and how they affect serialization.

Returns:

this object serialized as an XML document.  

yright">Copyright © 2001-2007, TIBCO Software Inc.