Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

LCDS Fetching a single row

Avatar

Level 2

Hello guys,

i need your help,

im doing Model Driven Development and want to know if there is a way to call a service method Synch  NOT Asynch.

All the calls are Asynch.

"

               var funcionarioToken:AsyncToken = new FuncionarioService().getAll();

            funcionarioToken.addResponder(new AsyncResponder(
                function (event:ResultEvent, token:Object=null):void
                {
                    _funcionarioInput.dataProvider = event.result;
                },
                function (event:FaultEvent, token:Object=null):void
                {
                    Alert.show("Associated service call failed: " + event.fault.faultString, "Error");
                }));

"

Is  there a way to define the return type of the service calls, for exemple  , if i want to fetch a single row from a database table by its ID how  would i do?

var myVar:MyObjectType =  event.result as MyObjectType; ??????

regards

Imraan

1 Accepted Solution

Avatar

Correct answer by
Employee

Just as you are specifying a "fill", you can specify a "get-item" that takes an identifier and returns a single item.

Client side doc is here:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/data/DataService.html

View solution in original post

7 Replies

Avatar

Employee

You could write your own code to simulate it, but everything in Flash is asyncronous.

Tom

Avatar

Level 2

Hello Tom,

thanks for the reply.

But what about returning a single object rather than a Arraycollection?

Regards

Imraan

Avatar

Employee

Sorry, everything in Flash/Actionscript is async, even though it would be nice sometimes if it wasn't.

Tom

Avatar

Correct answer by
Employee

Just as you are specifying a "fill", you can specify a "get-item" that takes an identifier and returns a single item.

Client side doc is here:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/data/DataService.html

Avatar

Level 2

thanks for the reply.

Regards

Imraan

Avatar

Employee

oops, sorry I was still stuck on Async and you were asking about getItem().

Tom

Avatar

Level 2

its OK Tom.

at least you answered

Regards,

Imraan