cancel
Showing results for 
Search instead for 
Did you mean: 

Flex: Nested tables as parameter

Former Member
0 Kudos

Hi,

is it possible to use nested tables as parameter when transfering data from WD ABAB to Flex?

In ABAP I have the following context:

Node Level0 (cardinality 0..n)

-Node Level1 (cardinality 0..n)

--Attribute att1.1

--Attribute att1.2

--...

-Attribute att1

-Attribute att2

-...

In Flex I have this:

[Bindable]

public var level0:ArrayCollection;

[Bindable]

public var att1:String;

[Bindable]

public var att2:String;

[Bindable]

public var ..:String;

[Bindable]

public var level1:ArrayCollection;

[Bindable]

public var att1.2:String;

[Bindable]

public var att1.2:String;

[Bindable]

public var ...:String;

It works not as it should be. Any ideas?

Thanks and redards,

Roman

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Yes you can do nested datasets. Here are some instructions from the developer on this topic:

There are two ways to access the child data source. The first is to just use the normal data source declaration, if you do that you will get the lead selected (or default selected) child data source. Lets say your context looks like this:

context root

+-A (context node)

+-a1 (context attr)

+-a2 (context attr)

+-B (context node)

|

+-b1 (context attr)

+-b2 (context attr)

And lets say you create your Flash Island with a GACDataSource name="A" and a child GACDataSource name="B"

In your Flex code you would declare:

public var A:Object;

public var B:Object;

"A" would be set to the lead selected node for context node "A" and "B" would be set to the lead selected node for context node "B".

If, however, you would like to iterate through the all of the child context nodes you can use the getDataSourceFieldName FlashIsland function to get the correct child's field name. Given the previous example the following should work:

public function set A(val:Object) : void {

if(!(val is IList))

return;

var mainDS = val as IList;

var childDSField:String = FlashIsland.getDataSourceFieldName(this, B);

for(var i:int=0; i<mainDS.length; i++) {

var mainDSRowObject = mainDS<i>;

var thisRowsChildDS:Object = mainDSRow[childDSField];

Alert.show('Child ' + i +

': attr1: ' + thisRowsChildDS[BAttr1Field] +

' attr2: ' + thisRowsChildDS[BAttr2Field]);

}

}

public var B:Object;

public var BAttr1Field:String;

public var BAttr2Field:String;

Answers (0)