日期:2014-05-17 浏览次数:21024 次
var form = Ext.create('Ext.form.Panel',{ // The fields bodyPadding: 5, id:'form', // standardSubmit:true, bodyPadding: '10 10 0', height:320, defaults: { anchor: '100%', allowBlank: false, labelWidth: 60 }, items: [ { xtype: 'textfield', blankText :'名称不能为空!', fieldLabel: '名称', name: 'floorName', allowBlank: false },{ xtype: 'textfield', blankText :'ip地址不能为空!', fieldLabel: 'IP地址', name: 'ip', allowBlank: false },{ xtype: 'textfield', blankText :'总线编号不能为空!', fieldLabel: '总线编号', name: 'can', allowBlank: false },{ xtype: 'textfield', blankText :'比例不能为空!', fieldLabel: '比例尺', name: 'scale', allowBlank: false },{ fieldLabel: '地图', blankText :'地图不能为空!', xtype:'filefield', name: 'file', anchor: '100%', labelWidth: 60, allowBlank: false },{ xtype: 'textarea', height:120, fieldLabel: '描述', name: 'desc' }], buttons: [{ text: '重置', handler: function() { this.up('form').getForm().reset(); } }, { text: '提交', formBind: true, //only enabled once the form is valid handler: function() { var form = this.up('form').getForm(); if (form.isValid()) { form.submit({ url: 'addFloor.action?building='+floorId, mthod:'post', waitMsg: '正在上传文件请稍后......', success: function(form, action) { Ext.Msg.alert('Success', '保存成功!'); Ext.getCmp("tree").getLoader().load(); Ext.getCmp("tree").expand(true); }, failure: function(form, action) { Ext.Msg.alert('Failed', '保存失败'); } }); } } }] })
public class LocateFloorExtAction extends BaseAction { String floorName;//楼层名称 String ip;//ip地址 String can;//总线编号 File file;//地图 String desc;//描述 String scale;//比例尺 String building;//楼层id ILocateBuildingService buildingService; ILocateFloorService service;