1

I am using mosync 3.1. I have created a listbox and added labels as listbox items. I want to be able to retrieve the text or name of the label that is selected.

user1622343
  • 967
  • 5
  • 9

1 Answers1

0

You should implement a "ItemSelectedListener" class and override the virual "itemSelected" method as this:

virtual void itemSelected (ListBox *sender, Widget *selectedWidget, Widget *unselectedWidget)

and then use this ListBox method:

"void addItemSelectedListener (ItemSelectedListener *listener)"

When an item selected in ListBox, the "itemSelectd" method has been called with "selected widget". Then you can get a text:

((Label*)selectedWidget)->getText()

hich9n
  • 1,578
  • 2
  • 15
  • 32