Ext学习中,遇到的问题真不少。其中一个action.result.msg为空

Ext.onReady(function(){

Ext.QuickTips.init();
var msg = function(title, msg){
Ext.Msg.show({
title: title,
msg: msg,
minWidth: 200,
modal: true,
icon: Ext.Msg.INFO,
buttons: Ext.Msg.OK
});
};
var fp = new Ext.FormPanel({
renderTo: 'fi-form',
fileUpload: true,
width: 500,
frame: true,
title: '上传文件',
autoHeight: true,
bodyStyle: 'padding: 10px 10px 0 10px;',
labelWidth: 60,
defaults: {
anchor: '95%',
allowBlank: false,
msgTarget: 'side'
},
items: [{
xtype: 'textfield',
fieldLabel: '组 名',
id: 'txtfile',
name: 'txtfile',
inputType: 'text' //文件类型
},{
xtype: 'fileuploadfield',
id: 'ffile',
emptyText: '请选择文件',
fieldLabel: '文件路径',
name: 'fpath',
buttonCfg: {
text: '',
iconCls: 'upload-icon'
}
},{
xtype: 'textfield',
fieldLabel: '信 息',
id:'txtinfor',
name: 'txtinfor',
inputType: 'text'
}],
buttons: [{
text: '上 传',
handler: function(){
if(fp.getForm().isValid()){
fp.getForm().submit({
url: '/proExam1/UploadFile',
waitMsg: '正在上传,请稍后.....',
method:'POST',
waitTile:'提示',
success: function(fp,action){
Ext.MessageBox.alert('提示',"fsdfsd"+action.result.msg); //msg('信 息', ""+action.result.msg);
}
});
}
}
},{
text: '取 消',
handler: function(){
fp.getForm().reset();
}
}]
});
});
</head>
<body>
<div id="fi-form"></div>
</body>
</html>
以上是一个客户端的html
然后提交到servlet或者action都行的。
问题主要是我提交后,没有的到是否提交成功后者失败的信息提示.
function(fp,action){
Ext.MessageBox.alert('提示',"fsdfsd"+action.result.msg); //msg('信 息', ""+action.result.msg);
这里可是写了的。
刚开始我打印action,发现有值。然后打印action.result为undefined,晕了半天发现时再servlet中的一个print的问题.
记住使用out.print("{success:true,msg:'fsdfds'}");
success是对应表单的success函数
result.msg对应的是servlet中的msg,明白这些后就不会出现为空的值了
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值