JSON dhtmlX + Struts2

Hello
I have to developed struts 2 application.
I have one Action class which has map a string variable
I don´t know inicialization my grip with a json with my variable.

This code is ok: :smiley:

var js={
rows:[
{ id:1001,
data:[
“100”,
“A Time to Kill”,
“John Grisham”,
“12.99”,
“1”,
“05/01/1998”] },
{ id:1002,
data:[
“1000”,
“Blood and Smoke”,
“Stephen King”,
“0”,
“1”,
“01/01/2000”] }
]}
grid.parse(js,“json”);

In my jsp I capture the variable return by my Action
<s:hidden id=“cadena” value="%{JsonResult}"/>

..... var cadena= document.getElementById("cadena").value; alert(cadena) ;// display String with json format.is OK. ...... grid.parse(cadena,"Json"); // ERROR This code has syntax error. I think the error is produced by String conversion to JSON. :angry: PLEASED HELPME!

grid.parse expects to receive the json object, not the string.
you can change your code as

var cadena= document.getElementById("cadena").value; eval("cadena="+cadena+";"); grid.parse(cadena,"Json"); // ERROR