Class gxe.control.Control
Base class for all renderable controls.
Controls are created and rendered based upon the configuration objects associated
with an editor (i.e. elements that define the editor).
Controls will only be rendered if an associated HTML tag name can be determined.
- If a configuration object explicitly defines an h:tag attribute, it will be used to create a corresponding HTML DOM element on the page.
- If a configuration object is defined within the GXE HTML namespace, then the local name of the configuration object will be used to create a corresponding HTML DOM element on the page.
The processing flow is as follows:
- instantiate
- ...initialize
- ...build
- ...execBuild
- ......importCfgProperties
- .........importHtmlAttributes
- ......createHtmlElement
- ......onHtmlElementCreated
- ......processChildren
- ......... (recursive on this process)
- ......onHtmlChildrenCreated
- ......parentControl.onChildControlCreated
Defined in: gxe.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
the associated editor configuration object
(i.e.
|
|
the editor context
|
|
a unique auto-generated ID for the control
|
|
the configured HTML attributes for the control
|
|
the HTML element to which the control is attached
|
|
the configured tag name for the HTML element
|
|
the configured text node content for the HTML element
|
|
the parent of this control
|
|
the targeted XML node.
|
|
the parent element of the targeted XML node
|
Method Attributes | Method Name and Description |
---|---|
build(htmlParentElement, domProcessor, domNode)
Builds the user interface control.
|
|
Creates the HTML element associated with the control.
|
|
ensureVisibility(subjectXmlNode)
Ensures the visibility of the HTML element associated with the control.
|
|
evaluateValue(value)
Evaluates a configuration value.
|
|
execBuild(htmlParentElement, domProcessor, domNode)
Executes the build of the the user interface control.
|
|
findFirstChildControl(sDojoSelector, the)
Finds the first child control that matches a Dojo query expression.
|
|
focus(subjectXmlNode)
Ensures the visibility of and focuses the HTML element associated with the control.
|
|
Gets the label text associated with a control.
|
|
importCfgProperties(cfgObject)
Imports configuration properties into the current control.
|
|
importHtmlAttributes(cfgObject)
Imports configuration attributes within the GXE HTML namespace into the current control.
|
|
initialize(context, cfgObject)
Initializes the instance.
|
|
processCfgAttribute(cfgAttribute, htmlParentElement, xmlParentElement, domProcessor, domNode)
Processes a configuration object associated with a targeted XML attribute (g:attribute).
|
|
processCfgElement(cfgElement, htmlParentElement, xmlParentElement, domProcessor, domNode)
Processes a configuration object associated with a targeted XML element (g:element).
|
|
processChildren(cfgObject, htmlParentElement, xmlNode, domProcessor, domNode)
Processes the children of a configuration object.
|
Event Attributes | Event Name and Description |
---|---|
fireOnEvent(e)
Explicitly fires the onEvent method.
|
|
onChildControlCreated(control, domProcessor, domNode)
Fired on a parent control when a child has been created.
|
|
onEvent(e, gxeControl, htmlEventName, gxeEventName)
Fired for certain events triggered by the control.
|
|
onHtmlChildrenCreated(domProcessor, domNode)
Fired when all of the children for a control have been created.
|
|
onHtmlElementCreated(domProcessor, domNode)
Fired when the HTML element for a control has been created.
|
Field Detail
{cfgObject}
cfgObject
the associated editor configuration object
(i.e. an editor definition element)
{gxe.Context}
context
the editor context
{String}
gxeId
a unique auto-generated ID for the control
{gxe.html.HtmlAttributes}
htmlAttributes
the configured HTML attributes for the control
{Element}
htmlElement
the HTML element to which the control is attached
{String}
htmlTag
the configured tag name for the HTML element
{String}
htmlTextContent
the configured text node content for the HTML element
{gxe.control.Control}
parentControl
the parent of this control
{gxe.xml.XmlNode}
xmlNode
the targeted XML node.
This is section based, many component controls target the same node.
(e.g. a header div, a label, an input text box can all target the same XML node)
{gxe.xml.XmlElement}
xmlParentElement
the parent element of the targeted XML node
Method Detail
build(htmlParentElement, domProcessor, domNode)
Builds the user interface control.
- Parameters:
- {Element} htmlParentElement
- the parent HTML element (a new control will be appended to this parent)
- {gxe.xml.DomProcessor} domProcessor
- an XML processor (when opening an existing document)
- {Node} domNode
- the DOM node that is actively being processed (when opening an existing document)
{Element}
createHtmlElement()
Creates the HTML element associated with the control.
- Returns:
- {Element} the HTML element (can be null)
ensureVisibility(subjectXmlNode)
Ensures the visibility of the HTML element associated with the control.
By default, no action is taken and the ensureVisibility method is triggered for the parent control.
By default, no action is taken and the ensureVisibility method is triggered for the parent control.
- Parameters:
- {gxe.xml.XmlNode} subjectXmlNode
- the subject XML node (can be null)
{Object}
evaluateValue(value)
Evaluates a configuration value.
- Parameters:
- {Object} value
- the value
- Returns:
- {Object} the evaluated value
execBuild(htmlParentElement, domProcessor, domNode)
Executes the build of the the user interface control.
- Parameters:
- {Element} htmlParentElement
- the parent HTML element (a new control will be appended to this parent)
- {gxe.xml.DomProcessor} domProcessor
- an XML processor (when opening an existing document)
- {Node} domNode
- the DOM node that is actively being processed (when opening an existing document)
findFirstChildControl(sDojoSelector, the)
Finds the first child control that matches a Dojo query expression.
- Parameters:
- {String} sDojoSelector
- the Dojo query expression
- {gxe.control.Control} the
- first matching child control (null if none)
focus(subjectXmlNode)
Ensures the visibility of and focuses the HTML element associated with the control.
- Parameters:
- {gxe.xml.XmlNode} subjectXmlNode
- the subject XML node (can be null)
getLabelText()
Gets the label text associated with a control.
- Returns:
- the label text (can be null)
importCfgProperties(cfgObject)
Imports configuration properties into the current control.
- Parameters:
- {cfgObject} cfgObject
- the associated configuration object
importHtmlAttributes(cfgObject)
Imports configuration attributes within the GXE HTML namespace into the current control.
(i.e. namespace "http://www.esri.com/geoportal/gxe/html")
(i.e. namespace "http://www.esri.com/geoportal/gxe/html")
- Parameters:
- {cfgObject} cfgObject
- the associated configuration object
initialize(context, cfgObject)
Initializes the instance.
- Parameters:
- {gxe.Context} context
- the editor context
- {cfgObject} cfgObject
- the associated editor configuration object (i.e. an editor definition element)
processCfgAttribute(cfgAttribute, htmlParentElement, xmlParentElement, domProcessor, domNode)
Processes a configuration object associated with a targeted XML attribute (g:attribute).
- Parameters:
- {cfgObject} cfgAttribute
- the configuration object to process
- {Element} htmlParentElement
- the parent HTML element (new controls will be appended to this parent)
- {gxe.xml.XmlElement} xmlParentElement
- the targeted XML parent element
- {gxe.xml.DomProcessor} domProcessor
- an XML processor (when opening an existing document)
- {Node} domNode
- the DOM node that is actively being processed (when opening an existing document)
processCfgElement(cfgElement, htmlParentElement, xmlParentElement, domProcessor, domNode)
Processes a configuration object associated with a targeted XML element (g:element).
- Parameters:
- {cfgObject} cfgElement
- the configuration object to process
- {Element} htmlParentElement
- the parent HTML element (new controls will be appended to this parent)
- {gxe.xml.XmlElement} xmlParentElement
- the targeted XML parent element
- {gxe.xml.DomProcessor} domProcessor
- an XML processor (when opening an existing document)
- {Node} domNode
- the DOM node that is actively being processed (when opening an existing document)
processChildren(cfgObject, htmlParentElement, xmlNode, domProcessor, domNode)
Processes the children of a configuration object.
- Parameters:
- {cfgObject} cfgObject
- the configuration object to process
- {Element} htmlParentElement
- the parent HTML element (new controls will be appended to this parent)
- {gxe.xml.XmlNode} xmlNode
- the target XML node
- {gxe.xml.DomProcessor} domProcessor
- an XML processor (when opening an existing document)
- {Node} domNode
- the DOM node that is actively being processed (when opening an existing document)
Event Detail
fireOnEvent(e)
Explicitly fires the onEvent method.
- Parameters:
- {Event} e
- the underlying browser event
onChildControlCreated(control, domProcessor, domNode)
Fired on a parent control when a child has been created.
This event fires after the child has been fully processed.
This event fires after the child has been fully processed.
- Parameters:
- {gxe.control.Control} control
- the child control
- {gxe.xml.DomProcessor} domProcessor
- an XML processor (when opening an existing document)
- {Node} domNode
- the DOM node that is actively being processed (when opening an existing document)
onEvent(e, gxeControl, htmlEventName, gxeEventName)
Fired for certain events triggered by the control.
- Parameters:
- {Event} e
- the underlying browser event
- {gxe.control.Control} gxeControl
- the control that fired the event
- {String} htmlEventName
- the HTML event name (e.g. "onclick")
- {String} gxeEventName
- a GXE name for the event (e.g. "onLabelClicked")
onHtmlChildrenCreated(domProcessor, domNode)
Fired when all of the children for a control have been created.
This event fires after all child controls have been added to the HTML DOM.
This event fires after all child controls have been added to the HTML DOM.
- Parameters:
- {gxe.xml.DomProcessor} domProcessor
- an XML processor (when opening an existing document)
- {Node} domNode
- the DOM node that is actively being processed (when opening an existing document)
onHtmlElementCreated(domProcessor, domNode)
Fired when the HTML element for a control has been created.
This event fires prior to the creation of child controls.
This event fires prior to the creation of child controls.
- Parameters:
- {gxe.xml.DomProcessor} domProcessor
- an XML processor (when opening an existing document)
- {Node} domNode
- the DOM node that is actively being processed (when opening an existing document)