Ext.form.FormPanel 提交之后转到另一个页面

59 篇文章 0 订阅
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>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值