How to access the java List of a custom class objects specified in <s:iterator> tag of jsp file inside my javascript function? -
i have jsp file in getting list of objects java action class (struts2) , displaying it.now want access these list objects within javascript method.how this?
mycode.jsp
<script type="text/javascript"> //some functions jquery(document).ready(function(){ $("#dialog-form").trigger('click'); //problem how access myobjectslist here //and of type mycustom class 2 class variables(i.e., name , id) //i need access name , id var colfamilies ='${myobjectslist}'; alert(myobjectslist); }); //some functions </script> <html> <!-- code --> <s:iterator value="myobjectslist" var="myobject"> <li><h4> <s:property value="#myobject.name" /> </a> </h4></li> <!-- code --> </html>
please give me suggestions tired of goggling since 2 days
i believe problem attempting assign list of non-primitive type javascript array.
this reply may helpful you. in short, may need converting rather straight assigning object. since linked reply uses static utility method, may need consider doing conversion on backend.
java javascript jquery iterator
No comments:
Post a Comment