cancel
Showing results for 
Search instead for 
Did you mean: 

DataSource - FlashIsland concepts issue

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (1)

Answers (1)

Former Member
0 Kudos

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