EXTJS之纠结错误
Ext.onReady(function() {
var formPanel = new Ext.form.FormPanel({
baseCls: 'x-plain',
labelWidth: 55,
url: 'save-form.php',
layout: {
type: 'vbox',
align: 'stretch' // Child items are stretched to full width
},
defaults: {
xtype: 'textfield'
},
items: [{
plugins: [ Ext.ux.FieldLabeler ],
fieldLabel: 'tittle',
allowBlank:false,
blankText:"标题不能为空",
msgTarget:"side",
name: 'articleTittle'
},{
plugins: [ Ext.ux.FieldLabeler ],
fieldLabel: 'type',
name: 'articleType',
allowBlank:false,
blankText:"文章类型不能为空",
msgTarget:"side"
}, {
xtype: 'textarea',
fieldLabel: 'text',
hideLabel: true,
name: 'articleText',
flex: 1, // Take up all *remaining* vertical space
allowBlank:false,
blankText:"文章内容不能为空",
msgTarget:"side"
}]
});
var w = new Ext.Window({
title: 'Compose message',
collapsible: true,
maximizable: true,
width: 750,
height: 450,
minWidth: 300,
minHeight: 200,
layout: 'fit',
plain: true,
bodyStyle: 'padding:5px;',
buttonAlign: 'center',
items: formPanel,
buttons: [{
xtype:"button",
height:5,
text:"save",
scope:this,
handler:doSave
},{
xtype:"button",
height:5,
text:"cancel",
scope:this,
handler:reset
}]
});
function doSave(){
formPanel.getForm().submit({
clientValidation:true,
waitMsg:"正在保存数据...",
url:"rjb/textBookAction.action",//struts.xml中的namespace为"/rjb",这里不要/
method:"POST",
success:function(form,action){
Ext.Msg.alert("提示","保存成功");
},
failure:function(form,action){
Ext.Msg.alert("提示","保存失败");
}
});
}
function reset(){
formPanel.form.reset();
}
w.show();
});
action为:
public class TextBookAction extends ActionSupport{
@Override
public String execute() throws Exception {
// TODO Auto-generated method stub
System.out.println("TextBookAction...");
return super.execute();
}
}
上面这个窗口,点提交时,后天action调到了,但是为什么"waitMsg:"正在保存数据..."却一直在,关不了,"Ext.Msg.alert("提示","保存成功");"也没弹出来!
求解求解!!
"