maybe last result contains the array collection?

Have not used granite, but if the combobox shows values, its data provider
is an arraycollection,
so what you are looking for is in:

imageManager.getImage.lastResult as arrayCollection

and not in imageManager.getImage

2009/2/10 amazoonea <[email protected]>

>    +------------------+
> + English message: +
> +------------------+
> hello,
>
> excuse my english but i'm french.
>
> i have a java method provided by an ejb session.
> i want to get the result of this method in flex
>
>
> the java method:
> public List<String> getImage(){
> //-> return a String List
> }
>
> I use graniteds to bind this methode in flex.
> So in flex i have a combobox which get the result of the java method
> in a dataProvider
>
> <mx:combobox dataProvider="{imageManager.getImage.lastResult}" />
>
> my application start well. I get all the image's url in the comboBox
> But what i want to do is creating an Image object dynamically!
>
> so i tried to do that :
>
> <mx: script>
> for (url:String in imageManager.getImage as array) {
> var image:Image = new Image;
> image.source = url
> this.addchild(image);
> }
> </script>
>
> i tried to go through the result to create dynamic instance of the
> Object Image. But imageManager.getImage is not an Array but an
> asyncToken !
>
> how can i do to go through the result ?
>
> i hope i was clear !
>
> thanks a lot !
>
>
> -------------------
>
> +--------------------+
> + Message français : +
> +--------------------+
>
> Bonjour
>
> j'ai une méthode en EJB3:
>
> public List<String> getImage(){
> //traitement -> retourne une liste de String
> }
>
> en flex j'utilise graniteDS pour utiliser mes méthodes définies en java.
>
> j'obtiens ceci (de tête)
>
> [code]
> <mx:combobox dataProvider="{imageManager.getImage.lastResult}" />
> [/code]
>
> à l'exécution de mon application, j'obtiens bien une comboBox
> contenant la liste des url de mes images.
>
> ce que je cherche à faire c'est récupérer la valeur de
> {imageManager.getImage.lastResult} et de parcourir le résultat pour
> créer des instance d'image, et ainsi afficher des images dynamiquement.
>
> du genre:
>
> <mx: script>
> for (url:String in imageManager.getImage as array) {
> var image:Image = new Image;
> image.source = url
> this.addchild(image);
> }
> </script>
>
> le problème est que imageManager.getImage est de type AsyncToken et je
> ne peux donc le parcourir.
>
> une idée ?
>
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
[email protected],

Reply via email to