I have actually thought about this, that is why I am trying to send the whole 
array collection back to the .NET web service.  So far, I have managed to get 
some grasp on this, but I think am missing something because when the 
arraycollection is processed in the backend .NET, there is no column name 
mapping with which the original data's column came from.

Say in my Flex App I have Columns1, Columns2, Columns3.  When I send the array 
collection to the .NET WebService, the first item in the ArrayList does not 
necessarily correspond to the first column and so forth.

Thanks for the pointers. Good to learn a lot lot more.




________________________________
From: Tim Hoff <timh...@aol.com>
To: flexcoders@yahoogroups.com
Sent: Tuesday, 9 June, 2009 0:05:49
Subject: [flexcoders] Re: ArrayCollection to Delimited String





Good point.  I suppose that you could throw in some regex to strip that 
character out of the objects before concatenating.  It's an edge case though.  
Pipe delimited strings are common in legacy systems; due to the rare usage of a 
pipe in text.
-TH

--- In flexcod...@yahoogro ups.com, Johannes Nel <johannes.nel@ ...> wrote:
>
> if this has to be imported somewhere else you need to consider, what happens
> if your delimiter is in a piece of text?
> 
> On Sun, Jun 7, 2009 at 2:25 PM, Angelo Anolin angelo_anolin@ ...wrote:
> 
> >
> >
> > Hi Tim,
> >
> > Thanks for the tip(s). Was able to make this thing work out.
> >
> > Regards,
> >
> > Angelo
> >
> > ------------ --------- ---------
> > *From:* Tim Hoff timh...@...
> > *To:* flexcod...@yahoogro ups.com
> > *Sent:* Friday, 5 June, 2009 14:05:46
> > *Subject:* [flexcoders] Re: ArrayCollection to Delimited String
> >
> > Well, let's not assume anything:
> >
> > private *function* parseArrayCollectio n():*void*
> > {
> > *var* myString:String = *""*;
> >
> > *for* *each* ( *var* myObject:Object *in* myAC )
> > {
> > myString += myObject.label + *"|"* + myObject.data + *"||"*;
> > }
> > *
> > trace*(myString) ;
> > }
> >
> > -TH
> >
> >
> > --- In flexcod...@yahoogro ups.com, "Tim Hoff" TimHoff@ wrote:
> > >
> > >
> > > Assuming that you don't want the trailing pipes:
> > >
> > > private function parseArrayCollectio n():void {
> > >
> > >
> > >
> > > var myString:String = "";
> > >
> > >
> > >
> > > for each ( var myObject:Object in myAC )
> > > {
> > > myString += myObject.label + "|" + myObject.data;
> > >
> > > if ( myAC.getItemIndex( myObject ) < myAC.length - 1 )
> > > {
> > > myString += "|";
> > > }
> > > }
> > >
> > > trace(myString) ;
> > > }
> > >
> > > -TH
> > >
> > > --- In flexcod...@yahoogro ups.com, Angelo Anolin angelo_anolin@
> > > wrote:
> > > >
> > > > Hi FlexCoders,
> > > >
> > > > Supposed I have an ArrayCollection variable represented like below:
> > > >
> > > > <mx:ArrayCollection id="myAC">
> > > > <mx:Array id="myArray">
> > > > <mx:Object label="MI" data="Lansing" />
> > > > <mx:Object label="MO" data="Jefferson City"/>
> > > > <mx:Object label="MA" data="Boston" />
> > > > <mx:Object label="MT" data="Helena" />
> > > > <mx:Object label="ME" data="Augusta" />
> > > > <mx:Object label="MS" data="Jackson" />
> > > > <mx:Object label="MN" data="Saint Paul"/>
> > > > </mx:Array>
> > > > </mx:ArrayCollection>
> > > >
> > > > I want to store the same in a String variable where the resulting
> > > string would be like:
> > > >
> > > > var ResultString: String;
> > > > ResultString = "MI|Lansing| |MO|Jefferson
> > > City||MA|Boston| |MT|Helena| |ME|Augusta| |MS|Jackson| |MN|Saint Paul||"
> > > >
> > > > How do I achieve this?
> > > >
> > > > Inputs highly appreciated. Thanks.
> > > >
> > > > Regards,
> > > >
> > > > Angelo
> > > >
> > >
> >
> > 
> >
> 
> 
> 
> -- 
> j:pn
> \\no comment
>

   


      

Reply via email to