PDA

View Full Version : submit form goes to failure section



rafmak1
12 May 2016, 6:00 AM
hi,
i have a grid when i submit most of time go to failure section despite the sql query still running in server side
Here the code

NewTestReportForm.getForm().submit({ waitMsg: 'In progress....', params: { Action: 'SaveVersionTestScenario', product:product_id,version:version_id,test_plan:test_plan_id, grid:testsgrid}
, success: function (response, options)
{
CategoryStore.reload();
if (test_plan_id != undefined && test_plan_id == options.result.test_plan_id)
{
Ext.MessageBox.show({ title: 'Success', msg: 'The test plan is successfully saved', buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO });
loadInterface();
store.reload();
}else
{
Ext.MessageBox.show({ title: 'Success', msg: 'A new test plan is successfully added.', buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.INFO });
test_plan_id=options.result.test_plan_id;
loadInterface();
store.baseParams={Action: "GetVersionAllTestScenario",product:product_id, version: version_id, test_plan: test_plan_id};
store.reload();

}

}
, failure: function (response, options)
{
if (options.result)
{
if (!options.result.session) {
Ext.MessageBox.alert('Session', 'Your session is down. You will be redirected to the login page.');
mytime = setTimeout('Logout()', 5000);
}
else if (options.result.warning != '') {
Ext.MessageBox.show({ title: 'Warning', msg: options.result.warning, buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.WARNING });
}
else {
Ext.MessageBox.show({ title: 'Error', msg: 'Unable to save test scenarios.', buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.ERROR });
}
}
else // always come here
{
Ext.MessageBox.show({ title: 'Error', msg: 'Unable to save test scenarios.', buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.ERROR });
}

}
});
}
else {
Ext.MessageBox.show({ title: 'Warning', msg: 'Please fill in the required fields', buttons: Ext.MessageBox.OK, icon: Ext.MessageBox.WARNING });
}

is there an idea to wait long query finishing ?
Regards

Gary Schlosberg
12 May 2016, 6:51 AM
About how long is your server taking to respond on average?

rafmak1
12 May 2016, 8:12 AM
i don't know exactly but after i finsh my query i return a response with json format

Response.Write("{success:true,session:true,warning:'',test_plan_id:'" + TestPlanID + "'}");