Fileupload form validation issue

52 views
Skip to first unread message

Bingyu Jiang

unread,
Nov 29, 2011, 11:19:09 AM11/29/11
to Netzke
The form with fileupload => true, when validation fails, the add/
edit_in_form will close immediately.

Jiang

wfilser

unread,
Dec 16, 2011, 8:49:47 AM12/16/11
to Netzke
I've had the same issue and got around it by changing the form panel's
javascript (form_panel.js) as follows:


if (this.fileUpload) {
this.getForm().submit({ // normal submit
url: this.endpointUrl("netzke_submit"),
params: {
data: Ext.encode(values) // here are the correct values
that may be different from display values
},
failure: function(form, action){
if (this.applyMaskCmp) this.applyMaskCmp.hide();
},
success: function(form, action) {
try {
var respObj = Ext.decode(action.response.responseText);
this.bulkExecute(respObj);
// close window only if there are no errors
if ( respObj["setResult"] == true) {
this.fireEvent('submitsuccess');
}
}
catch(e) {
Ext.Msg.alert('File upload error',
action.response.responseText);
}
if (this.applyMaskCmp) this.applyMaskCmp.hide();
},
scope: this
});

The issue is that the "submitsuccess" event should only be fired when
the submit was successfull.


On 29 Nov., 17:19, Bingyu Jiang <customer.ji...@gmail.com> wrote:
> The form withfileupload=> true, whenvalidationfails, the add/

Reply all
Reply to author
Forward
0 new messages