<form action="" method="post" name="commonObject" id="commonObjectForm"> <td align="right" width="10%" class="tdStyle01">客户号:</td> <td class="tdStyle02" width="20%"> <input type="text" name="commonObject.UDF01" id="COMPANY_SYSID"/> </td> 取值、赋值都是根据commonObject.UDF01进行,id的值用于JSP界面的脚本校验等操作 function submitQuery(){ var url="basCusAction.commitQuery.action"; var pars = Form.serialize('commonObjectForm');//获取到FORM表单传向JAVA new Ajax.Request(url, {parameters: pars,onLoading:openLoadMsgBox($("butQuery")), onSuccess: function(response) { setSystemMsg("查询成功!"); var jsonResult = response.responseText; //alert(jsonResult); var obj = getJsonStr(jsonResult); initGridForQuery(); mygrid.parse(obj,"json"); setQueryUrl(url,pars);//用于分页操作,吧当前查询的路径和参数传入pageview页面 setPageValue(obj.totalCount,obj.pageCount,obj.pageIndex,obj.pageSize);//用于分页操作,设置查询返回的分页参数 hidnLoadMsgBox($("butQuery"));//实现方法在util.js中 },onFailure: function(err){//ajax执行出错时调用的方法 alert(err.responseText); hidnLoadMsgBox($("butQuery"));//实现方法在util.js中 } }); } protected String executeQuery() throws Exception { DataPage<CustomerFromObj> dp = cusDao.queryBasCus(commonObject, pagination.getPageIndex(), pagination.getPageSize()); pagination.setValues(dp); String jsonStr = JsonUtil.assemleJsonStr(dp.getLightResultSet(), "UDF01", pagination);//查询完毕返回JSON System.out.println("~~~~~~~"+jsonStr); //String jsonStr = cusDao.queryBasCus(customer); //response.getWriter().write(jsonStr); return jsonStr; }
?