As long as your assembler's "createItem" method populates identity property of 
the item passed in, it should be returned to the client and updated there when 
the commit response is received by the client.     To help diagnose why this is 
not happening, first upgrade to 2.6.1 (on the product download page) since it 
has better diagnostics than the earlier versions.   Secondly, enable the 
server's debug log target for Service.*.    In the logs, should see it calling 
your createItem method and what value gets returned for the identity property.  
If it all looks correct there, check the client <mx:TraceTarget/> logs and make 
sure that value makes it back to the client.   It should indicate in the client 
logs that it is updating the cache and that the id property is getting updated 
there.

Jeff

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Besite - Bart
Sent: Sunday, January 18, 2009 5:25 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] LCDS - adding a new Item using createItem()


Hello,

In my Data Management Service I create a new User-object using the
createItem() function :

ds.createItem(new User("Jeff"));
var token:AsyncToken = ds.commit();
token.kind = "create";

When the commit is sent, the new User is persisted to the server... In
my database an autoincrement id is generated,
but the object returned to the Flex client has still an id equal to 0.

How do I know the unique id of the created User-object on the
client-side ? I need this unique id to do some remote calls as soon as
it is created on the server...

Any help is welcome !

Kind regards
Bart

<<inline: image001.jpg>>

<<inline: image002.jpg>>

Reply via email to