The more I've studied this, the more I think I'm asking the wrong 
question. I think that I really need to be merging two objects, and 
then adding them to the arrayCollection.

I have object1 that contains: userID, firstName, lastName, phoneNumber

and I have object2 that contains: eventID

The trick here is that except for the userID field, the other fields 
will vary in number and name, because I've externalized the 
itemRenderer so that developers can structure their own view for 
their own data.

I need to merge the two objects into a 3rd object.


--- In [email protected], "Tracy Spratt" <tspr...@...> wrote:
>
> I haven't looked at Alex's example(which is probably a big mistake 
on my
> part...), but here are some thoughts.  
> 
>  
> 
> You haven't said what the ArrayCollection is a collection *of*.  So 
it
> is probably a collection of dynamic Objects.  
> 
>  
> 
> Normally this is not a problem, but in many cases, it is better to 
have
> a strongly typed VO(value object), as this gives the access best
> performance.
> 
>  
> 
> So, since you need another property, I suggest you create a vo 
class.
> Make the whole class Bindable, unless you want to do different.  
Include
> all the fields in your normal object, plus add your special field to
> that class.
> 
>  
> 
> Then, in your result handler, loop over your array of objects, and 
build
> an ArrayCollection of your Vos.  One approach to this is to have a
> "fill" method that takes the basic data object and populates the 
class
> instance property values.
> 
>  
> 
> You wind up with the field you need, plus a best-case performance
> situation.
> 
>  
> 
> If you want the shortcut, just loop over the items and add the new 
field
> to the dynamic object.
> 
>  
> 
> Tracy
> 
>  
> 
> ________________________________
> 
> From: [email protected] 
[mailto:[email protected]] On
> Behalf Of jmfillman
> Sent: Wednesday, January 07, 2009 7:34 PM
> To: [email protected]
> Subject: [flexcoders] Re: Modify arrayCollection Structure
> 
>  
> 
> I need to add an extra field where data will be added. The field 
> would be empty, to start, and isn't coming from another 
> arrayCollection to merge with the original.
> 
> JF
> --- In [email protected] <mailto:flexcoders%
40yahoogroups.com>
> , Alex Harui <aharui@> wrote:
> >
> > Merged array list example on my blog
> > 
> > From: [email protected] <mailto:flexcoders%
40yahoogroups.com>
> 
> [mailto:[email protected] <mailto:flexcoders%
40yahoogroups.com>
> ] On Behalf Of jmfillman
> > Sent: Wednesday, January 07, 2009 3:54 PM
> > To: [email protected] <mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Modify arrayCollection Structure
> > 
> > 
> > Is there a good way to add a "column" of data to an 
arrayCollection?
> > 
> > For example, I have an arrayCollection with the following
> > data "columns" as received from my remoteObject call:
> > 
> > id, firstName, lastName, phoneNumber
> > 
> > I need to add an extra "column" for use in my app:
> > 
> > id, firstName, lastName, phoneNumber, date
> > 
> > I don't need the last field saved in my database, but I haven't 
> found
> > a good way to add this extra "column" to the arrayCollection 
short 
> of
> > creating the extra field in the database and passing it back to my
> > app with the query results. This seems unnecessary to have 
a "dummy"
> > field in my database. I could probably loop through the results 
and
> > add them to another arrayCollection with my needed structure, but
> > from a performance standpoint in my app, that's a less desirable
> > option than just using the "dummy" field.
> > 
> > Are there other options?
> > 
> > JF
> >
>


Reply via email to