JavaS
function loadList(){
loader.load(showList);
}
function showList(da
if (typeof window['DWRUtil'] == 'undefined')
window.DWRUtil = dwr.util;
DWRUtil.addOptions("listid",da
}
java代码:
package com.loadlist;
imp
imp
public class LoadList {
private List list;
public LoadList(){
list=new ArrayList();
list.add("1111");
list.add("2222");
list.add("3333");
list.add("4444");
}
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}
public List load(){
return list;
}
}
dwr.xml代码:
<dwr>
<allow>
<filter class="org.directwebremoting.filter.AuditLogAjaxFilter" />
<create creator="new" javas
<param name="class" value="com.loadlist.LoadList"></param>
</create>
</allow>
</dwr>
jsp代码:
<body on
<select id="listid" ></select>
</body>
错误:'DWRUtil'未定义
1、如果路径没有问题的话,请查看util.js里面
if (typeof window['DWRUtil'] == 'undefined')
window.DWRUtil = dwr.util;
是不是被注释了。把屏蔽注释了,问题就解决了。
2、在自定义的js里面加上
if (typeof window['DWRUtil'] == 'undefined')
window.DWRUtil = dwr.util;
DWRUtil.addOptions(......);
就可以了