Hello All,
I'm submitting a very simple form (2 fields) using form.submit(). I have no errors what so ever, rather my error handling is not being launched.
I have created a unique contraint on a field. When contraint is violated I send back the below JSON (verified correct syntax in JSLint).
Code:
{"success": false, "errCode":"-1", "errMsg":"ORA-00001: unique constraint (ORIFLAME.ORI_CIRCUITS_CON1
) violated"}
So now all my code seems correct, and when success is true, then everything goes alright. Is there something I am doing wrong....
Thanks in Advance
Jack
Code:
,handler: function(){
if (circuitInsertForm.getForm().isValid()) {
circuitInsertForm.getForm().submit({
waitMsg:'Saving Data...'
,url: baseURL + '/wwv_flow.show?p_flow_id='+$v('pFlowId')+'&p_flow_step_id=0&p_instance='+$v('pInstance')+'&p_request=APPLICATION_PROCESS%3DINSERT_CIRCUIT'
,success: function(form,action){
var json = Ext.util.JSON.decode(action.response.responseText);
if(json.success !== true) {
Ext.Msg.show({
title: json.errCode
,msg:Ext.util.Format.ellipsis(json.errMsg, 2000)
,icon:Ext.Msg.ERROR
,buttons:Ext.Msg.OK
,minWidth:1200 > String(json.errMsg).length ? 360 : 600
});
} else {
store.reload();
circuitInsertWindow.hide();
}
}
});
}else {
Ext.MessageBox.show({
title: 'Error'
,buttons: Ext.MessageBox.OK
,icon: Ext.MessageBox.ERROR
,msg: 'Please make sure all fields are filled!'
});
}
}