[flexcoders] For Each loop with ArrayCollection

2006-08-13 Thread michrx7
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

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





RE: [flexcoders] For Each loop with ArrayCollection

2006-08-13 Thread Bjorn Schultheiss





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 michrx7Sent: 
Monday, 14 August 2006 2:35 PMTo: 
flexcoders@yahoogroups.comSubject: [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



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___