OverviewSingleDeprecated

jsx3.gui

class Select

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

All Implemented Interfaces:

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

class Select
extends jsx3.gui.Block
The JSX version of a standard GUI select box. XML drives the contents of the select box.

This class requires a CDF data source. The supported CDF attributes are:

Field Summary
static String
ARROWICON
The URL of the arrow image.
static String
Deprecated.
static String
Deprecated. Renamed to DEFAULTXSLURL.
static String
Deprecated.
static String
DEFAULTCLASSNAME
jsx30select_select
static String
Deprecated. This value is now localized.
static String
DEFAULTXSLURL
The URL of the default XSL template of a normal select box.
static String
Deprecated. This value is now localized.
static String
Deprecated. This value is now localized.
static String
OVERIMAGE
The URL of the mouse over background image.
static String
SELECTEDIMAGE
The URL of the selected background image.
static String
Deprecated.
static String
Deprecated. Renamed to DEFAULTXSLURL.
static int
TYPEAHEADDELAY
The number of milliseconds of delay for the combo typeahead function.
static int
TYPECOMBO
Value of the type field indicating a combo select box.
static int
TYPESELECT
Value of the type field indicating a normal select box.
Constructor Summary
void
init(strName : String, vntLeft : int | String, vntTop : int | String, vntWidth : int | String, vntHeight : int | String, strSelectedValue : String)
The instance initializer.
Method Summary
int
Returns STATEVALID if this select box is not required or if it is required and its value is not empty.
HTMLElement
Gives focus to this select box.
String
Returns the text to display in this select box if the value of this select box is null.
int
Returns the maximum length allowed for the input field of this combo control.
String
If this is a normal select box returns the value of the jsxtext attribute of the selected CDF record, or if this is a combo select box returns the current value.
int
Returns the type of this select box.
String
Returns the value of this select box.
static String
Deprecated.
jsx3.xml.Document
Returns the XSL appropriate to the select type (either combo or select) if no custom XSLT is specified.
void
hide(bFocus : boolean)
Hides the drop-down portion of this select control.
String
Returns the DHTML representation of this select box.
jsx3.gui.Select
redrawRecord(strRecordId : String, intAction : int)
Redraws one record from the CDF data source of this select box.
jsx3.gui.Select
setDefaultText(strDefaultText : String)
Sets the text to display in this select box if the value of this select box is null.
jsx3.gui.Select
setMaxLength(intMaxLength : int)
Sets the maximum length allowed for the input field of this combo control.
jsx3.gui.Select
setText(strText : String)
Deprecated.
jsx3.gui.Select
setType(TYPE : int)
Sets the type of this select box.
jsx3.gui.Select
setValue(strRecordId : String)
Sets the selected record of this select control.
void
Displays the list of options for this select box.
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, 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
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

ARROWICON

static String ARROWICON
The URL of the arrow image.

COMBOXSLID

static String COMBOXSLID
Deprecated.
The default XSL id of a combo select box.

COMBOXSLURL

static String COMBOXSLURL
Deprecated. Renamed to DEFAULTXSLURL.
The URL of the default XSL template of a combo select box.

DEFAULTBACKGROUNDCOLOR

static String DEFAULTBACKGROUNDCOLOR
Deprecated.
The default background color of a select box.

DEFAULTCLASSNAME

static String DEFAULTCLASSNAME
jsx30select_select

DEFAULTTEXT

static String DEFAULTTEXT
Deprecated. This value is now localized.
The text label of the null record when no record is selected.

DEFAULTXSLURL

static String DEFAULTXSLURL
The URL of the default XSL template of a normal select box.

NODATAMESSAGE

static String NODATAMESSAGE
Deprecated. This value is now localized.

NOMATCHMESSAGE

static String NOMATCHMESSAGE
Deprecated. This value is now localized.

OVERIMAGE

static String OVERIMAGE
The URL of the mouse over background image.

SELECTEDIMAGE

static String SELECTEDIMAGE
The URL of the selected background image.

SELECTXSLID

static String SELECTXSLID
Deprecated.
The default XSL id of a normal select box.

SELECTXSLURL

static String SELECTXSLURL
Deprecated. Renamed to DEFAULTXSLURL.

TYPEAHEADDELAY

static int TYPEAHEADDELAY
The number of milliseconds of delay for the combo typeahead function.

TYPECOMBO

static final int TYPECOMBO
Value of the type field indicating a combo select box.

TYPESELECT

static final int TYPESELECT
Value of the type field indicating a normal select box.
Constructor Detail

init

void init(strName : String, vntLeft : int | String, vntTop : int | String, vntWidth : int | String, vntHeight : int | String, strSelectedValue : String)
The instance initializer.

Parameters:

strNameunique name distinguishing this object from all other JSX GUI objects in the JSX application
vntLefteither a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
vntTopeither a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
vntWidtheither a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
vntHeighteither a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
strSelectedValuethis value should correspond to the XML value for the node whose text should be preloaded in the select box when it is painted
Method Detail

doValidate

int doValidate()
Returns STATEVALID if this select box is not required or if it is required and its value is not empty. If this select is of type combo then any value other than an empty string is valid, otherwise only values corresponding to an actual CDF record of this select are valid.

Returns:

jsx3.gui.Form.STATEVALID or jsx3.gui.Form.STATEINVALID.  

Overrides:

doValidate in jsx3.gui.Form

focus

HTMLElement focus()
Gives focus to this select box. If this is a combo select, this method gives focus to the text edit box.

Returns:

the on-screen HTML element that was just given focus.  

Overrides:

focus in jsx3.gui.Painted

getDefaultText

String getDefaultText()
Returns the text to display in this select box if the value of this select box is null. If no value has been explicitly set with setDefaultText() a value appropriate to the server locale is returned.

Returns:

 

getMaxLength

int getMaxLength()
Returns the maximum length allowed for the input field of this combo control. This setting only has meaning if this control is of type TYPECOMBO.

Returns:

 

getText

String getText()
If this is a normal select box returns the value of the jsxtext attribute of the selected CDF record, or if this is a combo select box returns the current value.

Returns:

 

Overrides:

getText in jsx3.gui.Block

getType

int getType()
Returns the type of this select box.

Returns:

TYPESELECT or TYPECOMBO

See Also:

TYPESELECT, TYPECOMBO

getValue

String getValue()
Returns the value of this select box. The value is the jsxid attribute of the selected CDF record.

Returns:

the value or null if no record is selected.  

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 the XSL appropriate to the select type (either combo or select) if no custom XSLT is specified.

Returns:

jsx3.xml.Document instance  

Overrides:

getXSL in jsx3.xml.Cacheable

hide

void hide(bFocus : boolean)
Hides the drop-down portion of this select control.

Parameters:

bFocusif true, the form control will be focused after hiding the drop-down.

paint

String paint()
Returns the DHTML representation of this select box.

Returns:

DHTML  

Overrides:

paint in jsx3.gui.Block

redrawRecord

jsx3.gui.Select redrawRecord(strRecordId : String, intAction : int)
Redraws one record from the CDF data source of this select box. If strRecordId is equal to the selected record id, the text of this select box is set to the value of the record's jsxtext attribute.

Parameters:

strRecordIdthe id of the record that will be redrawn.
intActionINSERT, UPDATE, or DELETE.

Returns:

this object.  

Overrides:

redrawRecord in jsx3.xml.CDF

setDefaultText

jsx3.gui.Select setDefaultText(strDefaultText : String)
Sets the text to display in this select box if the value of this select box is null.

Parameters:

strDefaultTextany valid string. HTML markup is allowed, but may cause unpredicatable effects.

Returns:

this object.  

setMaxLength

jsx3.gui.Select setMaxLength(intMaxLength : int)
Sets the maximum length allowed for the input field of this combo control.

Parameters:

intMaxLength

Returns:

this object.  

setText

jsx3.gui.Select setText(strText : String)
Deprecated.
Sets the text to display in this select box while it is closed. This method does not affect the value of this select box, it simply affects the current view. This method does not affect the value returned by getText() either.

Parameters:

strTextthe text to display.

Returns:

this object. 

Overrides:

setText in jsx3.gui.Block

See Also:

getText()

setType

jsx3.gui.Select setType(TYPE : int)
Sets the type of this select box.

Parameters:

TYPETYPESELECT or TYPECOMBO.

Returns:

this object. 

See Also:

TYPESELECT, TYPECOMBO

setValue

jsx3.gui.Select setValue(strRecordId : String)
Sets the selected record of this select control. Fires the SELECT event only under the deprecated 3.0 model event protocol.

Parameters:

strRecordIdid for the record that will be the selected item.

Returns:

this object.  

Overrides:

setValue in jsx3.gui.Form

show

void show()
Displays the list of options for this select box.

/div>

Parameters:

intMaxLength

Returns:

this object.  

setText

jsx3.gui.Select setText(strText : String)
Deprecated.
Sets the text to display in this select box while it is closed. This method does not affect the value of this select box, it simply affects the current view. This method does not affect the value returned by getText() either.

Parameters:

strTextthe text to display.

Returns:

this object. 

Overrides:

setText in jsx3.gui.Block

See Also:

getText()

setType

jsx3.gui.Select setType(TYPE : int)
Sets the type of this select box.

Parameters:

TYPETYPESELECT or TYPECOMBO.

Returns:

this object. 

See Also:

TYPESELECT, TYPECOMBO

setValue

jsx3.gui.Select setValue(strRecordId : String)
Sets the selected record of this select control. Fires the SELECT event only under the deprecated 3.0 model event protocol.

Parameters:

strRecordIdid for the record that will be the selected item.

Returns:

this object.  

Overrides:

setValue in jsx3.gui.Form

show

void show()
Displays the list of options for this select box.