Use an AS class to wrap that functionaliy, something like (not tested)

[ResourceBundle("BundleName")]
public class CreditCard
{
        private resourceManager : ResourceManager;
        
        private key : String;
        private value : Object;

        public function CreditCard(key : String, value : Object)
        {
                resourceManager = ResourceManager.getInstance();
                
                this.key = key;
                this.value = value;
        }
        
        public function label() : String
        {
                return resourceManager.getString("BundleName", key);
        }
        
        public function data() : Object
        {
                return value;
        }
}

Then, create an ArrayCollection and add CreditCard-Instances.

Use the ArrayCollection as the dataprovider for the ComboBox


Alger


Tom Sobut wrote:
> 
> 
> I'm trying to find a way to localize the data used in a ComboBox 
> dataProvider. In a simple
> ComboBox dataProvider, I see that one might use 
> ResourceManager.getStringArray(). But I
> need to implement a provider that uses an array of objects with label 
> and data. What I need
> would look more like:
> 
> [ {label:"Visa", data:1}, {label:"MasterCard", data:2}, {label:"American 
> Express", data:3} ]
> 
> ResourceManager.getObject() doesn't do it. I don't see an obvious way to 
> fetch this type of a
> resource with the ResourceManager.
> 
> I would imagine that this is a common requirement in localization 
> efforts. Anyone run into
> this while localizing and find the solution? ...or is this a 
> roll-yer-own solution.
> 
> thanks
> 
> Tom
> 
> 

Reply via email to