Home > Element Reference : Richlistbox

Contents

### Richlistbox

Mozilla 1.8

This element is used to create a list of items, similar to a listbox, but is designed to be used when the items do not contain simple text content. The richlistbox supports selecting a single item at a time.

The richlistbox element implements the following interfaces:

nsIAccessibleProvider nsIDOMXULSelectControlElement

Attributes:

suppressonselect

Properties and Methods:

accessible | children | clearSelection | ensureElementIsVisible | ensureSelectedElementIsVisible
getItemAtIndex | getRowCount | goDown | goUp | scrollBoxObject
selectedIndex | selectedItem | suppressOnSelect

#### Attributes:

##### suppressonselect

Type: boolean

If this attribue is not specified, a select event is fired whenever an item is selected, either by the user or by calling one of the select methods. If set to true, the select event is never fired.

Inherited from XUL Element:

align | allowevents | allownegativeassertions | class | coalesceduplicatearcs
collapsed | container | containment | context | contextmenu
datasources | dir | empty | equalsize | flags
flex | height | hidden | id | insertafter
insertbefore | left | maxheight | maxwidth | menu
minheight | minwidth | mousethrough | observes | ordinal
orient | pack | persist | popup | position
preference-editable | ref | removeelement | sortDirection | sortResource
sortResource2 | statustext | style | template | tooltip
tooltiptext | top | uri | wait-cursor | width

#### Properties and Methods:

Inherited from XUL Element:

align
allowEvents
blur
boxObject
boxObject.element
boxObject.getLookAndFeelMetric
boxObject.height
boxObject.screenX
boxObject.screenY
boxObject.width
boxObject.x
boxObject.y
builder
className
click
collapsed
contextMenu
controllers
database
datasources
dir
doCommand
flex
focus
getElementsByAttribute
height
hidden
id
left
maxHeight
maxWidth
menu
minHeight
minWidth
observes
ordinal
orient
pack
persist
ref
resource
statusText
style
tooltip
tooltipText
top
width

Inherited from Element:

addEventListener
appendChild
attributes
childNodes
cloneNode
dispatchEvent
firstChild
getAttribute
getAttributeNS
getAttributeNode
getAttributeNodeNS
getElementsByTagName
getElementsByTagNameNS
hasAttribute
hasAttributeNS
hasAttributes
hasChildNodes
insertBefore
isSupported
lastChild
localName
namespaceURI
nextSibling
nodeName
nodeType
nodeValue
normalize
ownerDocument
parentNode
prefix
previousSibling
removeAttribute
removeAttributeNS
removeAttributeNode
removeChild
removeEventListener
replaceChild
setAttribute
setAttributeNS
setAttributeNode
setAttributeNodeNS
tagName

##### accessible

Type: nsIAccessible

Returns the accessibility object for the richlistbox.

##### children

Type: array of elements

Returns the list of items in the richlistbox.

##### clearSelection

Type: integer

Desleect the currently selected row, if any.

##### ensureElementIsVisible ( element )

Return Type: no return value

If the element in the list box is not currently visible to the user, the list box view is scrolled so that it is. If the item is already visible, no scrolling occurs.

##### ensureSelectedElementIsVisible ( )

Return Type: no return value

If the currently selected element in the list box is not currently visible to the user, the list box view is scrolled so that it is. If the item is already visible, no scrolling occurs.

##### getItemAtIndex ( index )

Return Type: richlistitem element

Returns the item that is at the position specified by the parameter index in the list box.

##### getRowCount ( )

Return Type: integer

Returns the total number of rows in the list box.

##### goDown ( )

Return Type: no return value

Move the selection down by one item.

##### goUp ( )

Return Type: no return value

Move the selection up by one item.

##### scrollBoxObject

Type: nsIScrollBoxObject

Th scroll box object implements the nsIScrollBoxObject interface, which may be used to retrieve and adjust the scroll position of the list box.

##### selectedIndex

Type: integer

Set to the index of the currently selected item in the list. This property may be set to change the selection.

##### selectedItem

Type: element

Set to the currently selected item in the list. This property may be set to change the selection.

##### suppressOnSelect

Type: boolean

Gets and sets the value of the suppressonselect attribute.

Copyright (C) 1999 - 2004 XulPlanet.com