I have the following s:List
<s:List
id="lstOther"
borderVisible="false"
width="100%" height="100%"
dataProvider="{this.handler.itemRendererType}"
labelFunction="labelFunction"
itemRendererFunction="itemRendererFunction">
</s:List>
The functions for itemRendererFunction and labelFunction look like this:
private function itemRendererFunction(item:Object):IFactory {
var clazz:Class = DefaultItemRenderer;
switch(item.data) {
case "Security Unit":
clazz = CheckBox;
break;
default:
clazz = CheckBoxEditLabel;
}
return new ClassFactory(clazz);
}
private function labelFunction(item:Object):String {
return "testing";
}
My data provider (dataProvider="{this.handler.itemRendererType}") is composed as follows:
public var itemRendererType:ArrayCollection = new ArrayCollection([
{name:"otherLabel1", data:"Security Unit"},
{name:"otherLabel2", data:"Test 1"},
{name:"otherLabel3", data:"Test 2"}
]);
I first tried setting labelField in the s:List to 'name'. Nothing showed up in the list control. As can be seen above, I tried using a label function and returning a hard coded value ("testing"). Still nothing shows up.
Why is the text for the labels not showing up?
Any help would be greatly appreciated. Thanks!