Binding key/value pairs loaded from xml

Posted by Hichem on Stack Overflow See other posts from Stack Overflow or by Hichem
Published on 2010-03-12T00:34:31Z Indexed on 2010/03/12 0:37 UTC
Read the original article Hit count: 299

Filed under:
|
|
|
|

I want to load key/values configuration pairs stored in XML file. To bind a collection of data i know i need to use the ArrayList class, but the problem is that i want to be able to bind the loaded values using their corresponding keys and not by their indexes in the ArrayList object.

For example i want to be able to do this :

<mx:Text id="errorText" text="{Config.params['someKey']}" />

instead of :

<mx:Text id="errorText" text="{Config.params[0]}" />

where Config.params is ArrayList (obviously i couldn't use ArrayList since it doesn't allow selecting a value by key)

So the question is how to bind the key/value pairs loaded form XML. I don't want to go manually set variables, i want to bind them so when they are loaded the are set automatically. Did anyone had to do something like that ?

© Stack Overflow or respective owner

Related posts about flex

Related posts about as3