0
在JSP页面中我用支柱迭代器如何传递对象的列表js函数在支柱迭代器
<s:iterator value="categoryList" status="category"> //other code.. <a href="#" onclick="a_onClick('<s:property value="productsByOid"/>')"><s:property value="name"/></a> </s:iterator>
我想调用JS函数对象作为一个特性参数的清单。在那里我想迭代这个列表并获得产品属性(名称,价格)。我该怎么做 ?
function a_onClick(p) {
alert('a_onClick');
console.log(p);
}
在控制台接收:[[email protected]]
碎片模型类:
public class Category {
private Integer oid;
private String name;
private Collection<Product> productsByOid;
... }
public class Product {
private Integer oid;
private Integer dostPno;
private String opis;
private String name;
private String producent;
private String price;
private Category categoryByCategoryOid;
你想用这个做什么?一种可能的解决方案是将数据放入隐藏字段并在js中检索。 –