Login Register

what is the object type for new dojox.collections.ArrayList(????);

Hi All,

Im passing array list from jsp to my dojo page

this is my jsp code
<%

ArrayList strlist = new ArrayList();
strlist.add("BT");
strlist.add("PEGA");
strlist.add("PandO");

%>

<%=strlist %>

this is my dojo code

function fromServer(){
dojo.xhrGet({
url: 'GetAccName.jsp',
load: getNames,
error: helloError

});
}

function getNames(data,ioArgs) {
var alist = new dojox.collections.ArrayList(["foo","bar","test","bull"]);
var alist2 = new dojox.collections.ArrayList(data);
console.debug(alist.toString()); // foo,bar,test,bull
console.debug(alist2.toString()); // [BT, PEGA, PandO]

testGetIterator(alist); //*** method 1 ***
testGetIterator(alist2); //*** method 2 ***
}

function testGetIterator(alist) {

var itr=alist.getIterator();
while(!itr.atEnd()){
console.debug(itr.get());
}
}

Out puts

//*** method 1 ***
foo
bar
test
bull

//*** method 2 ***
[BT, PEGA, PandO]

this is not i want as putput in method 2 i want it as method 1
I want this ->
BT
PEGA
PandO

so i think problem is passing the parameter to the constructor. can't we pass java.util.ArrayList object to dojox.collections.ArrayList. then what is the way to pass to list of String to jsp to dojo.

Please help me.......!

Thanks and best Regards,
Sajeevi.