--- In [email protected], "j_lentzz" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> I have a general question about when to use the two methods
> itemUpdated and setItemAt on ArrayCollections.
> 
> if you use obj = getItemAt(someIndex) and then change some properties
> in the obj, what difference is there between using
> setItemAt(obj,someIndex) or using itemUpdated(obj)?  Is there a
> particular reason to choose one over the other?
> 
> Thanks,
> 
> John
>

you generally use setItemAt if you need to completly replace the
object in that part of the arraycollection. For instance, we have a
backend delegate class that instantiates new objects all the time,
each being different but needs to replace the item that already exists
in the collection (each object being replaced is progressivly more
lightweight) so SetItemAt is necessary for us, its more costly because
the view has to completly rerender for that item. getItemAt would be
better if you are just changing a few attributes on the object,
because a view only needs to change if certain attributes are
different from before.

Thants what i think anyway

Reply via email to