Class fvaswing.components.forms.FvListField

Description

Combobox form field.

Choices must be added to field before adding field into a form object.

Example

   var combo : FvComboField = new FvComboField( "Your primary pccupation", true );
   combo.addChoice( "basket-ball" );
   combo.addChoice( "football" );
   combo.addChoice( "actionscript" );   combo.addChoice( "nothing...too tired" );
 

Method Index

new FvListField()
addChoice(), clear(), getValue(), setModel(), setValue(), setVisibleRowCount()

Inherited from FvFormField

Constructor Detail

FvListField

public function FvListField(label:String, minSelection:Number, selectionMode:Number)

Constructor.

Parameters

labelField's caption
minSelectionMinimum elements selection to be valid
selectionMode( optional ) Defines if user can select only one element or more
Available values are :
  • JList.SINGLE_SELECTION
  • JList.MULTIPLE_SELECTION
Default is calculated using minSelection argument

Method Detail

setVisibleRowCount

public function setVisibleRowCount(n:Number):Void

Sets the preferred number of rows in the list that can be displayed.
Default is 5.

Must be defined before adding field into a form object.

setValue

public function setValue(values:Array):Void

Sets selected field value.

getValue

public function getValue():Array

Returns selected value.

addChoice

public function addChoice(o:Object):Void

Adds new choice to combobox.

Choices must be added to field before adding field into a form object.

Parameters

setModel

public function setModel(model:ListModel):Void

Sets in one step the list content using passed-in model definition.

When setModel() is call, all added choices added with addChoice() are ignored.

Model must be defined before adding field into a form object.

clear

public function clear():Void

Clears field value.