XIFF RosterItemVO displayName


I am trying to populate a datagrid with displayName attribute from RosterItemVO class

here is the code

var items:Array = chatManager.roster.toArray();

var len:uint = items.length;

arr = new Array[ len ];

for (var i:uint = 0; i < len; ++i)


var item:RosterItemVO = items[i] as RosterItemVO;

arr[ i ] = item.displayName;


rosterGrid.dataProvider = arr;

its not displaying the data…even i tried new ArrayCollection(arr) also…its not working

In debug mode the loop is running correctly and fetching all the names…

Only its not able to assign the data in arr to dataProvider

any suggestions

pls reply

hi devs

any idea on above loop…how to make it correct

If the data is populating in the array correctly, this just seems like a general Flex datagrid question.

I don’t use Flex too often, so I’m not exactly sure what the issue is.

I figured it out from SearchWindow.mxml page of SparkWeb

this is the correct and working code

var arr:Array = new Array();

for(var i:uint=0; i<chatManager.roster.length; i++)


var rosterItem:RosterItemVO = chatManager.roster.getItemAt(i);

var name:String = rosterItem.displayName.toString();

arr.push( { Name:name } );


rosterGrid.dataProvider = arr;