function getUpdateForm() {
win.title = '修改考勤信息';
if(!form){
form = new Ext.FormPanel({
labelWidth : 75,
//url :'UpdateEmployee.action',
frame : true,
bodyStyle : 'padding:5px 5px 0',
width : 340,
defaults : {
width : 230
},
defaultType : 'textfield',
standardSubmit : true,
items : [{
fieldLabel : 'id',
name : 'employee_id',
readOnly : true
}, {
fieldLabel : '姓名',
name:'name',
allowBlank : false
}, { fieldLabel : '业务室',
name : 'department'
}, {
fieldLabel : '上午',
name : 'morning'
}, {
fieldLabel : '下午',
name : 'afternoon'
}, {
fieldLabel : '日期',
name : 'datenote'
}, {
fieldLabel : '备注',
name : 'note'
}],
buttons : [{
text : '保存',
// formBind : true,
type : 'submit',
// 定义表单提交事件
handler : function() {
if (form.form.isValid()) {// 验证合法后使用加载进度条
// 提交到服务器操作
form.form.doAction('submit', {
url : '../UpdateEmployee.action',// 文件路径
method : 'post',// 提交方法post或get
params : '',
// 提交成功的回调函数
failure : function(retForm, retAction) {
if (retAction.result && retAction.result == '1') {
Ext.MessageBox.alert('提示', '保存数据成功!');
win.hide();
/* var totalCount = ptb.store.getTotalCount();
var pageSize = ptb.pageSize;
var div = parseInt(totalCount / pageSize);
var mol = totalCount % pageSize;
ptb.cursor = div * pageSize;*/
ds.load({
params : {
start : 0,
limit : 10
}
}); } else if (retAction.result
&& retAction.result == 'error') {
Ext.MessageBox.alert('提示', '保存数据失败!');
} else {
Ext.Msg.alert('错误', '服务器出现错误请稍后再试!');
}
},
waitMsg : '保存数据...'
});
}
}
}, {
text : '取消',
handler : function() {
form.form.reset();
}// 重置表单
}]
});
}
return form;
//////////////////////////////
public String UpdateEmployee() {
//System.out.println(this.employee.getEmployee_id() + "---" + this.employee.getName() + "---");
this.setJsonString("{success:true}");
System.out.println(this.getJsonString());
try {
this.getEmployeeService().updateEmployee(this.getEmployee());
} catch (Exception e) {
e.printStackTrace();
}
return SUCCESS;
}
///////////////////////////////////////
怎么是这个错误呢?attempt to create saveOrUpdate event with null entity
win.title = '修改考勤信息';
if(!form){
form = new Ext.FormPanel({
labelWidth : 75,
//url :'UpdateEmployee.action',
frame : true,
bodyStyle : 'padding:5px 5px 0',
width : 340,
defaults : {
width : 230
},
defaultType : 'textfield',
standardSubmit : true,
items : [{
fieldLabel : 'id',
name : 'employee_id',
readOnly : true
}, {
fieldLabel : '姓名',
name:'name',
allowBlank : false
}, { fieldLabel : '业务室',
name : 'department'
}, {
fieldLabel : '上午',
name : 'morning'
}, {
fieldLabel : '下午',
name : 'afternoon'
}, {
fieldLabel : '日期',
name : 'datenote'
}, {
fieldLabel : '备注',
name : 'note'
}],
buttons : [{
text : '保存',
// formBind : true,
type : 'submit',
// 定义表单提交事件
handler : function() {
if (form.form.isValid()) {// 验证合法后使用加载进度条
// 提交到服务器操作
form.form.doAction('submit', {
url : '../UpdateEmployee.action',// 文件路径
method : 'post',// 提交方法post或get
params : '',
// 提交成功的回调函数
failure : function(retForm, retAction) {
if (retAction.result && retAction.result == '1') {
Ext.MessageBox.alert('提示', '保存数据成功!');
win.hide();
/* var totalCount = ptb.store.getTotalCount();
var pageSize = ptb.pageSize;
var div = parseInt(totalCount / pageSize);
var mol = totalCount % pageSize;
ptb.cursor = div * pageSize;*/
ds.load({
params : {
start : 0,
limit : 10
}
}); } else if (retAction.result
&& retAction.result == 'error') {
Ext.MessageBox.alert('提示', '保存数据失败!');
} else {
Ext.Msg.alert('错误', '服务器出现错误请稍后再试!');
}
},
waitMsg : '保存数据...'
});
}
}
}, {
text : '取消',
handler : function() {
form.form.reset();
}// 重置表单
}]
});
}
return form;
//////////////////////////////
public String UpdateEmployee() {
//System.out.println(this.employee.getEmployee_id() + "---" + this.employee.getName() + "---");
this.setJsonString("{success:true}");
System.out.println(this.getJsonString());
try {
this.getEmployeeService().updateEmployee(this.getEmployee());
} catch (Exception e) {
e.printStackTrace();
}
return SUCCESS;
}
///////////////////////////////////////
怎么是这个错误呢?attempt to create saveOrUpdate event with null entity
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货