Christian,

> > <cfscript>
> > xArray = listToArray("1,2,3,4,5",",");
> > xIdx = xArray.indexOf("4");//
Yes, the above works.. since xArray is a Vector..

I am returning an ArrayList from a JavaBean Method..
Java Code
public ArrayList get2DArray(String str){
  String str1Arr [] = str.split("~");
  ArrayList al = new ArrayList();
  for(int i=0;i < str1Arr.length;i++)
    al.add(i,str1Arr[i].split("`"));
 return al;
 }//end get2DArray

As u can see i am returning 2DArray from a Nested List.
CF Code
<cfscript>
str = "1`2`3`4`5~1`2`3";
xAlist = xObj.get2DArray(str);
xIDx = xAlist[1].indexOf("3"); // This Breaks!

//Even the below breaks..

xAList = createObject("Java","java.util.ArrayList");
xAlist = xObj.get2DArray(str);
xIDx = xAlist[1].indexOf("3");
</cfscript>

"xAlist" should be Vector.. converted by CFMX, since
it gives me a Method Selection Exception..
ArrayList Class does NOT have an OverLoaded Method for "indexOf".
Vector Class does have an OverLoaded Methods for indexOf.

I think.. there might be an Internal CFMX Conversion Bug.
Appreciate your help.

Joe Eugene


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Christian Cantrell
> Sent: Monday, July 07, 2003 12:16 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [CFCDev] Java Vector/ArrayList Methods within CFMX
> 
> 
> On Sunday, July 6, 2003, at 05:01 PM, Joe Eugene wrote:
> 
> > I am trying to use ArrayList.indexOf(Object elem) and i get method
> > selection Exception
> >
> > This works... dont know why..
> > <cfscript>
> > xArray = listToArray("1,2,3,4,5",",");
> > xIdx = xArray.indexOf("4");// this returns 3.. since arrays start with
> > zero index in Java.
> > </cfscript>
> >
> > But when i return an ArrayList from Java.. and search ArrayList Object,
> > i get method selection exceptions.. indexOf is not overloaded for
> > ArrayList but is
> > overloaded for vectors.. Any Ideas how i can get this to work?
> 
> I'm not sure what the problem is here, but this code works:
> 
> <cfscript>
> // This is a Vector
> xArray = listToArray("1,2,3,4,5",",");
> xIdx = xArray.indexOf("4");
> writeOutput(xIdx);
> 
> // This is an ArrayList
> myArrayList = createObject("java", "java.util.ArrayList");
> myArrayList.add("a");
> myArrayList.add("b");
> myArrayList.add("c");
> writeOutput(myArrayList.indexOf("b"));
> </cfscript>
> 
> Am I missing the issue?
> 
> Christian
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
> in the message of the email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported
> by Mindtool, Corporation (www.mindtool.com).
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

Reply via email to