Hi Dirk,

Your # 1 is pretty close to how things work. If the fill params match then the 
items in the current collection will be refreshed to the latest values from the 
server, including the application of any pending deletes/updates/etc you'd made 
to the previous collection contents but haven't committed that can be applied 
to the new contents. If the params differ then the current items in the 
collection are fully released if there are no other refs to them (from a 
different fill() or getItem()) and the collection is cleared out and 
repopulated with the new set of managed items.

You should use releaseCollection() to un-manage a collection that you're done 
with; that lets the server know that it no longer needs to send you updates for 
those managed items when you have auto-sync enabled.

Best,
Seth

________________________________________
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dirk 
Eismann
Sent: Friday, September 01, 2006 12:44 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Calling fill() on the same collection multiple times

Hi,

simple question - and hopefully a simple answer :)

Imagine I have an ArrayCollection searchResult which is used to display
results returned from a fill() method. This fill() method gets invoked
with different additional arguments (the search query, additional filter
settinsg etc.).

What happens to the items in the ArrayCollection if I call fill() a
second time and pass in an ArrayCollection that already is filled with
different items?

1) they'll be released and removed from the DataStore automatically.
2) they won't be released - so over time the DataStore fills up with
"old" search result items.

I suspect 2) happens, right? In this case it seems to be a best practice
to release all items in an ArrayCollection that is frequently filled
with different item sets, right?

Dirk.
 


--
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