ListBox

ListBox Basic

ListBox component is used to select one or multiple values existing values

ListBox_Basic_0

InnerDataSet Binding

ListBox is basically used to present data by using the InnerDataSet.

Way of using ListBox Contents

ListBox_Contents_0

DataSet binding

ListBox is basically used to represent data binding with DataSet.

ListBox_Contents_1

If want to use characteristics data in ListBox we should have to bind InnerDataSet with DataSet, we take care there should be data in dataset first.

MultiSelect

ListBox_Contents_2

We can choose multiple rows in ListBox. There are two ways, first pressing control key then selecting value by mouse and second is pressing shift key then selecting value by mouse.

Getting selected value

this.Button00_onclick = function (obj:Button, e:ClickEventInfo)
{
 var i;
 var select_Cnt = 0;
 var msg = "Selected Record \n";
 select_Cnt = this.ListBox02.getSelectedCount();
 for (i = 0; i < select_Cnt; i++) 
 {
  if (this.ListBox02.getSelect(i) == true) 
  {
   msg += "Row : " + i + "\n";
  }
 }
 msg += "Selected Record Count : " + select_Cnt;
 this.alert(msg);
}

Select All values in ListBox

this.Button01_onclick = function (obj:Button, e:ClickEventInfo)
{
 for(i=0;i<this.ds_code.getRowCount();i++)
 {
  this.ListBox02.setSelect(i, true);
 }
}

Source Location

Sample\ListBox\np_ListBox_Basic.xfdl