02-20-2013 03:57 AM
Hello,
I'm new to AIR und QNX and try to working through RIM's documentation.
The program creates a list. If I click a button it should remove an item from the list. But it doesn't. Maybe anybody has an idea why?
Just a second question:
Is there a difference at all between this two lines? Which variant is to prefer?
myList.removeItemAt(1);
myList.dataProvider.removeItemAt(1);
Here the important code parts:
import qnx.fuse.ui.listClasses.List;
private function initializeUI():void
{
arrMonth.push({label: "Jan"});
arrMonth.push({label: "Feb"});
...
myList.dataProvider = new DataProvider(arrMonth);
}
private function myButtonEvent(event:MouseEvent):void
{
//now remove an item
//variante 1: works well!
myList.removeItemAt(1);
//HERE THE ERROR OCCURS
//variante 2: doesn't work
//error message: Could not find the item to remove
myList.removeItem({label: "Jan"});
//I'm still not understanding the label thing. So I tried this but it didn't work either
myList.removeItem("Jan");
}
Thanks a lot,
Sebastian
Solved! Go to Solution.
02-20-2013 08:12 AM
02-20-2013 08:25 AM
Yes, the call removeItemAt works.
But I would like to understand how removeItem works - it's described in the documentation :-). So it should work
02-20-2013 09:06 AM
02-20-2013 05:10 PM
Thank you very much, the picture is becoming clearer and brighter now :-)
SB