:: Forum >> Version 2 >>

set data from string array

Hi,

I want to set the items of a list control from a string array. I am using jsp to attempt to accomplish this:

<%
// Pretend this string array has text in it.
String[] s = new String(3);
%>

<script>
obj.setItemText(s);
</script>

Everytime I run this the list shows up empty. But I can print out the contents of the array and there are definitely values in there. What must I change?

Thanks
markw
Sunday, March 12, 2006
In this part s (I guess) is a java array on the server

String[] s = new String(3);

But here it should be a javascript array on the client

obj.setItemText(s);

To make it work you should serialize java array into javascript (JSON) format and sent it to the browser together with the rest of the page/script code.
Alex (ActiveWidgets)
Monday, March 13, 2006



This topic is archived.

Back to support forum

Forum search