Either with dataService.getItem, if the item exists and you have its 
id or dataService.createItem if the item does not exist and you want 
to create a new one.  

If you need to actually execute a query to retrieve the item (e.g. 
you are trying to retrieve a User by the lastName), you have to use 
the fill method to pass in the parameters and just have that fill 
method return a Collection with just one item.  In this case, the 
fill method returns an AsyncToken whose responder will be called when 
the fill results are returned to the client.  At that point, you 
could look at the filled array collection and call getItemAt(0) to 
get the first item in the list.

Jeff

--- In flexcoders@yahoogroups.com, "Dmitry Miller" <[EMAIL PROTECTED]> 
wrote:
>
> I have a managed class.
> 
> [Managed]
> class User
> {
>   ....
> }
> 
> 
> and in the main application .mxml file I have a reference of this 
type
> that I want to manage by a data service
> 
> 
> i.e.
> 
> <mx:DataService id="ds" destination="userSvc" />
> <mx:Script>
>      [Bindable]
>      public var me:User;
> </mx:Script>
> 
> Now, how do I get to populate variable "me" and get it maneged by 
userSvc?
> 
> Thanks,
> 
> --- Dmitry
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to