<basedatacombobox>

baseclass for a datacombobox

JavaScript: basedatacombobox

Extends Baseformitem
Attributes
Name Usage Type (Tag) Type (JS) Default Category
defaulttext Tag & JS string String   setter
 

Default text to display before a selection is made. No default item is selected if defaulttext is set. Defaulttext is replaced with selected item's text.


ismenu Tag & JS expression any false setter
 

If true, the combobox will behave like a menu. "value" is ignored, and items will not remain selected. Selecting an item generates an onselect event


isopen Tag & JS expression any false setter
 

Indicates whether or not the popup list is showing.


itemclassname Tag & JS string String   setter
 

The name of the class for items in the floating list.


itemdatapath Tag & JS string String null setter
 

Datapath to items in list.


listattach Tag & JS string String bottom setter
 

Where the floatinglist should attach to its owner. Possible values: bottom, top, left, right. In the event of a canvas out-of-bounds, the floating list will attach in a visible location. default: bottom


listwidth Tag & JS expression any null setter
 

Width of popup list, defaults to width of combobox view. During setup, the width of the floating list view might not yet be set, so this returns the expected width. If not set,


menuclassname Tag & JS string String   setter

selected Tag & JS expression any null readonly
 

Datapointer to selected item.


selectfirst Tag & JS expression any true setter
 

When true, the 1st item is selected oninit.


shownitems Tag & JS expression any 4 setter
 

Sets the height to the number of items to show in combobox popup list. Default is 4, must be greater than 0.


statictext Tag & JS string String   setter
 

If set, this will always be displayed instead of selected item text. Behaves like a menu button. Also see defaulttext.


textdatapath Tag & JS string String text() setter
 

Datapath to text to display for items in list. See caveat.


valuedatapath Tag & JS string String @value setter
 

Datapath to value for items in list. See caveat.



Attributes inherited from Basecomponent

doesenter, enabled, hasdefault, isdefault, style, styleable, text

Attributes inherited from Baseformitem

changed, ignoreform, rollbackvalue, submit, submitname

Attributes inherited from Basevaluecomponent

value

Attributes inherited from Node

class, classroot, cloneManager, datapath, id, ignoreAttribute, ignoreplacement, immediateparent, initstage, name, nodeLevel, onconstruct, oninit, parent, placement, subnodes

Attributes inherited from View

aaactive, aadescription, aaname, aasilent, aatabindex, align, bgcolor, clickable, clickregion, clip, cursor, defaultplacement, fgcolor, focusable, focustrap, font, fontsize, fontstyle, frame, framesloadratio, hassetheight, hassetwidth, height, layout, loadratio, mask, onblur, onclick, ondata, ondblclick, onfocus, onkeydown, onkeyup, onmousedown, onmouseout, onmouseover, onmouseup, onselect, opacity, options, pixellock, play, resource, resourceheight, resourcewidth, rotation, selectiontype, showhandcursor, source, stretches, subviews, totalframes, unstretchedheight, unstretchedwidth, valign, visible, width, x, xoffset, y, yoffset


Methods

getItemIndex()
basedatacombobox.getItemIndex(value)

Get item's index by value. Note: If you have a stray character in dataset, this will break. CDATA is included in nodes.length.

Parameters
Name Type Desc
value Object the value of the item to select.


getValue()
basedatacombobox.getValue()

Override getValue because we don't want to return this.text if this.value is null (this.text may be the defaulttext)



selectItem()
basedatacombobox.selectItem(value)

Select an item by value.

Parameters
Name Type Desc
value Object the value of the item to select.


selectItemAt()
basedatacombobox.selectItemAt(index)

Select an item by index.

Parameters
Name Type Desc
index Number the index of the item to select.


setChanged()
basedatacombobox.setChanged(isChanged)

Setter to set baseformitem to changed. Should be called by subclasses whenever a value is set. The first time this is called, the changed value is not set since it assumes subclasses are setting their initial value. This also updates the selected value in the combobox to reflect the new value (in case it was changed).

Parameters
Name Type Desc
isChanged Boolean true if changed, else false.


setOpen()
basedatacombobox.setOpen(open)

Sets the open/close state of the popup list.

Parameters
Name Type Desc
open Boolean true to open the list, else false to close.


setValue()
basedatacombobox.setValue(value, isinitvalue, ignoreselection)

Set value of combobox.

Parameters
Name Type Desc
value String|Number value to set.
isinitvalue Boolean true if value is an init value.
ignoreselection None


toggle()
basedatacombobox.toggle()

Toggles the open/close state of the popup list.



Methods inherited from basecomponent

doEnterDown, doEnterUp, doSpaceDown, doSpaceUp, setStyle, setTint, updateDefault

Methods inherited from baseformitem

applyData, commit, findForm, init, rollback, setChanged, setValue, toXML, updateData

Methods inherited from basevaluecomponent

getValue

Methods inherited from LzNode

animate, applyConstraint, childOf, completeInstantiation, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, lookupSourceLocator, searchImmediateSubnodes, searchSubnodes, setAttribute, setDatapath, setID, setName, setOption

Methods inherited from LzView

addProxyPolicy, addSubview, bringToFront, construct, containsPt, getAttributeRelative, getBounds, getColor, getColorTransform, getContextMenu, getCurrentTime, getDepthList, getHeight, getID3, getMouse, getPan, getTotalTime, getVolume, getWidth, measureHeight, measureWidth, play, releaseLayouts, removeProxyPolicy, searchParents, searchSubviews, seek, sendBehind, sendInFrontOf, sendToBack, setAAActive, setAADescription, setAAName, setAASilent, setAATabIndex, setAlign, setAttributeRelative, setBGColor, setClickable, setColor, setColorTransform, setContextMenu, setCursor, setHeight, setLayout, setOpacity, setPan, setPlay, setResource, setResourceNumber, setRotation, setShowHandCursor, setSource, setValign, setVisible, setVolume, setWidth, setX, setY, shouldYieldFocus, stop, stretchResource, unload, updateResourceSize


Events
Name Description
onchanged None
oncomboblur None
oncombofocus None
onisopen None
onselected None
onvalue None

Events inherited from baseformitem

onchanged, onvalue

Events inherited from LzNode

onconstruct, ondata, oninit

Events inherited from LzView

onaddsubresource, onaddsubview, onblur, onclick, ondblclick, onerror, onfocus, onframe, onheight, onlastframe, onload, onmousedown, onmousedragin, onmousedragout, onmouseout, onmouseover, onmouseup, onmouseupoutside, onopacity, onplay, onremovesubview, onstop, ontimeout, onwidth, onx, ony