RE: [flexcoders] FDMS: check, if an item exists on the client?

2006-08-28 Thread Dirk Eismann
Hi Jimmy, I don't think there's a getItem() method on ArrayCollection. There's only getItemAt() but that's useless as I don't have the index of the item. Actually, all I know about the item is the unique ID (i.e. the PK from the DB table) so what I need is something like

RE: [flexcoders] FDMS: check, if an item exists on the client?

2006-08-28 Thread Dirk Eismann
FYI: if an ArrayCollection is managed by a DataService, then the list property of the ArrayCollection is of type mx.data.DataList. This DataListholdsa localItems Array which seems to track the references to the items available in this list. As the items are [Managed] (implement

RE: [flexcoders] FDMS: check, if an item exists on the client?

2006-08-28 Thread Dimitrios Gianninas
ahh, even better, good to know and good luck! Dimitrios Gianninas RIA Developer Optimal Payments Inc. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dirk EismannSent: Monday, August 28, 2006 5:58 AMTo: flexcoders@yahoogroups.comSubject: RE: [flexcoders]

RE: [flexcoders] FDMS: check, if an item exists on the client?

2006-08-28 Thread Dimitrios Gianninas
Oh ya I meant to say getItemAt(). Hmm, no index eh, that means you'd have to iterate through the collection to find the one u want, not the most effiecient way. But if you are displaying the collection in a DataGrid, then u could get the index by doing dg.selectedIndex, I think that

[flexcoders] FDMS: check, if an item exists on the client?

2006-08-25 Thread Dirk Eismann
Is there any way in FDMS to get an item without really going to the server if it's on the client already? I found that calling dataService.getItem(uid) always goes to the server, even if the item in question is available on the client. This is unnecessary overhead IMHO if the item is available

RE: [flexcoders] FDMS: check, if an item exists on the client?

2006-08-25 Thread Seth Hodgson
Hi Dirk, getItem() will always fetch the current state of the requested object from the server and update the local instance with the result if it exists. If you don't have auto sync enabled (server pushed updates) this is how you can periodically refresh your local instance. If you call

RE: [flexcoders] FDMS: check, if an item exists on the client?

2006-08-25 Thread Dimitrios Gianninas
I think what you are looking for is: myArrayCollection.getItem( x ); Assuming myArrayCollection was populated by the fill() method of a DataService. Dimitrios Gianninas RIA Developer Optimal Payments Inc. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dirk