I'm using a List
which I need to be empty at the start. I'm adding items to it as needed by clicking a button. Since it's empty, I haven't added a dataProvider
property
<s:List id="thelist" itemRenderer="listIR" />
To add an item, I'm adding it to the dataProvider
directly
thelist.dataProvider.addItem()
but when I do that, it gives me this error
#1009: Cannot access a property or method of a null object reference.
Also I have a debugging Alert
in the listIR
itemRenderer itself and I see that when the list is created, I get that alert twice as if 2 itemRenderers were created, even though the list is supposed to be empty at the start.
Any ideas what's wrong with this itemRenderer? How do I start with an empty dataProvider and add items smoothly to it?