Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Problem accessing results from DataService fill method

Avatar

Level 1
I've set up an application that gets data from a data service

configured with a java-dao adapter. If I define a DataGrid
with the

array populated by the fill method I see the data in the
grid. Cool.

So I know I've configured and coded everything correctly.



However, if I try to access the data with the following code,
it

appears my array is empty!



ray = new ArrayCollection();

ds = new DataService("assets");

ds.fill(ray);

var asset:Asset = ray[0];



This gives me an index '0' out of bounds error. I've also
tried

ray.getItemAt(0) with the same results.



How do I access and manipulate the results of a fill method
via

ActionScript? I'm currently using Beta3.
1 Accepted Solution

Avatar

Correct answer by
Level 2
Note that it takes time to actually make the dataservice call
and retrieve the results. Your data won't be available right away.
After calling fill(), you have to wait for the "result" event of
the DataService object.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 2
Note that it takes time to actually make the dataservice call
and retrieve the results. Your data won't be available right away.
After calling fill(), you have to wait for the "result" event of
the DataService object.

Avatar

Level 1
Thank you sir. That did the trick.