mytestcompanyOutput = mytestcompanyOutput + testcompanyValue + "\n";
should be
mytestcompanyOutput = mytestcompanyOutput + testCompany[ testcompanyValue ] + "\n";
Regards,
 
Bjorn Schultheiss
Senior Flash Developer
QDC Technologies
 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of michrx7
Sent: Monday, 14 August 2006 2:35 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] For Each loop with ArrayCollection

In my flex app I send a company name over to a cfc. The CFC returns
a query of company names with close matches.

I am trying to output that list of names in an Alert but keep
getting a list of [object Object]

Of course the number of items in that list matches the number that
should be returned by the query and I can dump the arraycollection
into a datagrid and see the right information, but I can't simply
list it out into an Alert.

Here is my function:

private function checkcompanyHandler(event:ResultEvent):void {
testCompany = event.result as ArrayCollection;
var mytestcompanyOutput:String = "";
for each (var testcompanyValue in testCompany) {
mytestcompanyOutput = mytestcompanyOutput + testcompanyValue + "\n";
}
if (testCompany.length > 0) {
Alert.show("The following companies were found close to the company
you entered:\n\n" + mytestcompanyOutput + "\nContinue adding this
company?", "Company Name Matches", 3, this, companyclickHandler);
}
}

Here is the cfc query that feeds the event result:
SELECT cvcompanyName
FROM cvCompany
WHERE UPPER(cvcompanyName) LIKE UPPER('#VARIABLES.cvcompanyName#%')
ORDER BY cvcompanyName

Does someone see what I am doing wrong? I simply want a list of the
returned company names.

Thanks!

__._,_.___

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




__,_._,___

Reply via email to