on 12-02-2009 10:35 PM
Hi everyone, I´m working with FlashIslands and I guess I have a concept issue here with the GACDATASOURCE ....I just can´t iterate the arraycollection in flex.
in WD:
I have a node called A, with 3 attributes, the node cardinality can be 0 .... to N.
I have GACDataSource (Context Node) and three properties (Node Attributes) binded to the context
in flex :
I set a Bindable ArrayContainer object called "tableDataContainer"
I set a Bindable attribute for each of the properties
well, i cant get the attributes values, the arraycontainer is properly created.... the arrayContainer size and the context node size are both of 3, then i guess I already have the values in flex. but i cant get data, only Objects...
Try 1:
var obj:Object = tableDataContainer.getIndexAt(0);
Alert.show(obj["attr1"]);
Try2 :
var obj:Object = tableDataContainer.getIndexAt(0);
Alert.show(obj.attr1);
does everyone know how to iterate the plain content of the ArrayContainer ?
thanks
hi isaac,
not sure this is what you are looking for. i am a flex developer, have limited amount of knowledge of SAP.
the result of the following code:
Object 0 => name = p
Object 1 => name = m
Object 2 => name = e
completed code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
initialize="initApp(event);"
layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.FlexEvent;
import mx.collections.ArrayCollection;
private function initApp(event:FlexEvent):void
{
var leng:int = tableContainer.length;
for(var i:int=0; i<leng; i++)
{
trace("Object " + i + " => name = " + tableContainer<i>.name);
}
}
]]>
</mx:Script>
<mx:ArrayCollection id="tableContainer">
<mx:source>
<mx:Object id="p" name="p" />
<mx:Object id="m" name="m" />
<mx:Object id="e" name="e" />
</mx:source>
</mx:ArrayCollection>
</mx:Application>
normally, when i get the set of data from the server into my flex app, i will put them into value objects(vo) individually and add each vo to the array collection which is binded to the data source.
hopefully this helps.
Mike
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Isaac,
what data types did you use for the attributes in WD? There might be a conversion problem. I would suggest trying to use a String and verify if it works then.
You could also take a look at : [http://wiki.sdn.sap.com/wiki/display/EmTech/FlashIslandsusingWebdynprojava|http://wiki.sdn.sap.com/wiki/display/EmTech/FlashIslandsusingWebdynprojava] if you did not already.
Kind Regards,
Carl Heckmann
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.