var f = new Ext.form.FormPanel({
renderTo:"collectDiv",
title:"成果检索-查询条件",
width:800,
standardSubmit:true,
url:queryUrl,
method:"POST",
autoHeight:true,
labelWidth:300,
labelAlign:"right",
buttonAlign:'center',
frame:true,
defaults:{xtype:"textfield",width:200,labelStyle:"font-weight:normal;",triggerAction:"all",msgTarget:'under'},
items:[
{xtype:"panel",
fieldLabel:"文献库",
autoHeight:100,
width:300,
columnWidth : .50,
columnWidth : .50,
// layout : "column",// 也可以是table,实现多列布局
layout:"table",
layoutConfig:{
columns:1
},
isFormField : true,// 非常重要,否则panel默认不显示fieldLabel
items : [
{xtype:"checkbox",name:"fruit_lib_sel",inputValue:0,boxLabel:"全选",checked:false},
{xtype:"checkbox",name:"fruit_lib",inputValue:1,boxLabel:"中国知网(期刊文章、会议论文、学位论文)",checked:false},
{xtype:"checkbox",name:"fruit_lib",inputValue:2,boxLabel:"万方(期刊文章、会议论文、学位论文)",checked:false},
{xtype:"checkbox",name:"fruit_lib",inputValue:3,boxLabel:"Science Citation Index Expanded (SCIE)",checked:false},
{xtype:"checkbox",name:"fruit_lib",boxLabel:"Social Sciences Citation Index (SSCI)",checked:false},
{xtype:"checkbox",name:"fruit_lib",boxLabel:"Index to Scientific & Technical Proceedings (ISTP)",checked:false},
{xtype:"checkbox",name:"fruit_lib",boxLabel:"Engineering Village (EI Compendex)",checked:false},
{xtype:"checkbox",name:"fruit_lib",boxLabel:"ScienceDirect",checked:false},
{xtype:"checkbox",name:"fruit_lib",boxLabel:"Scopus",checked:false},
{xtype:"checkbox",name:"fruit_lib",boxLabel:"中国知识产权网",checked:false}
]
},
{name:"fruit_name",fieldLabel:"标题",allowBlank:false,blankText:"该项必须填写,不能为空"},
{name:"authors",fieldLabel:"作者"},
{name:"company_name",fieldLabel:"单位名称"},
{name:"time_span",fieldLabel:"发表年份"}],
buttons:[{text:"查询",handler:function(){
f.getForm().submit();
}},
{text:"重置",handler:function(){
f.form.reset();
}}]
});
将form的参数配置项,都配置在formpanel里面,而不是submit里面,就可以了。
java:
@RequestMapping("/turnToCollectResult") public ModelAndView turnToCollectResult(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println(TimeUtils.getNowTime("yyyy-MM-dd HH:mm:ss") + "\t" + this.getClass().toString() + " /turnToCollectResult"); ModelAndView mv = new ModelAndView(); mv.setViewName("fruit.collect.result"); return MVFactory.getViewAuthInstance(mv); }
页面jsp内容:
<%@ page pageEncoding="utf-8"%> <%@ include file="/views/include.jsp"%> <script src='<c:url value="/js/fruit_collect.js"/>' type="text/javascript"></script> <div class="global_default_font"> <div id="collectDiv"></div> <input type="hidden" id="queryUrl" value="<c:url value="/turnToCollectResult.do"/>"> <input type="hidden" id="addUrl" value="<c:url value="/resultAdd.do"/>"> </div>