Jason,

Two questions/comments:

1. Are you not creating AsyncToken references from your calls to the
ds.createItem and ds.deleteItem?  So far you have pretty much what I
have, but things get tricky for me when I get the result or fault
callbacks.   If I have a fault, it gets called 2x for some reason.

2. Regarding the updates to a specific item:  Are you not keen on the
solution of just pulling the specific item to be updated from the
managed collection and updating it and then letting FDS take care of the
backend syncronization?  Or have you tried a call to ds.getItem() and
then modified the resulting object returned after the user has edit it? 
I'm just making sure you knew that it was possible, although it does not
quite follow them same pattern as createItem  and deleteItem.    I can
post code samples if you need them.

thanks
Bill

--- In [email protected], <[EMAIL PROTECTED]> wrote:
>
> Heya,
>
>
>
> I was looking for one too and there doesn't seem to be one.  I'm able
to
> currently encapsulate Create/Read/Delete actions in commands, but I
> haven't yet found a reliable way to encapsulate Updates in a command.
> Everything else works very nicely.
>
>
>
>
>
> Example of fill:
>
>
>
> var ev:ProductEvent = new ProductEvent(ProductEvent.FIND_ALL);
>
>       ev.collection = model.products;
>
>
>
> CairngormEventDispatcher.getInstance().dispatchEvent(ev);
>
>
>
> Execute:
>
> public function execute(event:CairngormEvent):void {
>
>       var ds:DataSource = new DataSource("productHome");
>
>       var ev:ProductEvent = event as ProductEvent;
>
>
>
>       ds.fill(ev.collection); // event is carrying a reference to an
> arbitrary collection contained in your model
>
> }
>
>
>
>
>
> Example of createItem:
>
>
>
> var ev:ProductEvent = new ProductEvent(ProductEvent.INSERT);
>
>       ev.product = someProduct;
>
>
>
> CairngormEventDispatcher.getInstance().dispatchEvent(ev);
>
>
>
> Execute:
>
> public function execute(event:CairngormEvent):void {
>
>       var ds:DataSource = new DataSource("productHome");
>
>       var ev:ProductEvent = event as ProductEvent;
>
>
>
>       ds.createItem(ev.product); // event is carrying a reference to a
> product bean
>
> }
>
>
>
>
>
>
>
>
>
> Example of deleteItem:
>
>
>
> var ev:ProductEvent = new ProductEvent(ProductEvent.DELETE);
>
>       ev.product = someProduct;
>
>
>
> CairngormEventDispatcher.getInstance().dispatchEvent(ev);
>
>
>
> Execute:
>
> public function execute(event:CairngormEvent):void {
>
>       var ds:DataSource = new DataSource("productHome");
>
>       var ev:ProductEvent = event as ProductEvent;
>
>
>
>       ds.deleteItem(ev.product); // event is carrying a reference to a
> product bean
>
> }
>
>
>
>
>
> When you find a good way to handle updates, you let me know ;)
> Currently there is no fine-grained approach to updating only one
> specific record manually, which kinda sucks.
>
>
>
> Jay Proulx
>
> [EMAIL PROTECTED]
>
> ________________________________
>
> From: [email protected] [mailto:[EMAIL PROTECTED]
On
> Behalf Of auddaraj
> Sent: February 26, 2007 2:54 PM
> To: [email protected]
> Subject: [flexcoders] Cairngorm FDS Sample
>
>
>
> Hi,
> We are planning to use Cairngorm in our flex project which uses FDS. I
> tried looking around for samples that use FDS(not remoting) but no
> luck. From www.cairngormdocs.org I am able to find number of sample
> that use webservices, remoting etc..
>
> Can anyone suggest a sample Cairngorm app that uses FDS(Data
> services). I am trying to see how FDS methods like fill etc. fit into
> cairngorm model
>
> Thanks,
> ANAND.
>


Reply via email to