• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 383
  • Last Modified:

flex dataProvider

Hello experts
Is it possible to use  Dictionnaries as dataprovider (or assocaitive arrays) in Flex ?
It seems I can use Array and ArrayCollection only as a dataprovider for a list component.
  • 2
1 Solution
zzynxSoftware engineerCommented:
I quote from the documentation:

dataProvider property

dataProvider:Object  [read-write]

Set of data to be viewed. This property lets you use most types of objects as data providers. If you set the dataProvider property to an Array, it will be converted to an ArrayCollection. If you set the property to an XML object, it will be converted into an XMLListCollection with only one item. If you set the property to an XMLList, it will be converted to an XMLListCollection. If you set the property to an object that implements the IList or ICollectionView interface, the object will be used directly.

As a consequence of the conversions, when you get the dataProvider property, it will always be an ICollectionView, and therefore not necessarily be the type of object you used to you set the property. This behavior is important to understand if you want to modify the data in the data provider: changes to the original data may not be detected, but changes to the ICollectionView object that you get back from the dataProvider property will be detected.

>> Is it possible to use  Dictionnaries as dataprovider
I think the answer is yes, since Dictionary is an Object. But since it doesn't implement IList or ICollectionView I wonder if it is of any use...
zzynxSoftware engineerCommented:
thanx 4 axxepting

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now