日期:2014-05-16 浏览次数:20322 次
private List<Engineer> engineerList; public void setEngineerList(List<Engineer> engineerList){ this.engineerList = engineerList; } public List<Engineer> getEngineerList(){ return this.engineerList; } public String queryEngineersByGroupId(){ //通过service方法查询出工程师列表(queryList),并放入engineerList中 this.setEngineerList(queryList); return SUCCESS; }
<package name="jsonpackage" extends="json-default" namespace="/json"> <action name="queryEngineersByGroupId" class="actionTest" method="queryEngineersByGroupId"> <result type="json"> <param name="includeProperties"> engineerList\[\d+\]\.id, engineerList\[\d+\]\.name </param> </result> </action> </package>
function queryEngineersByGroupIdCallBack(data){ var engineers = eval( "(" + data + ")" ); var len = engineers.engineerList.length; for(var i = 0 ; i < len ; i ++){ $("#divId").append("<input type='checkbox' name='engineerchk' value='" + engineers.engineerList[i].id + "'/>" + engineer.engineerList[i].name); } }