Hi All!!! Still on there exception problem. Had dropped the project for a while. Now I'm back still with the same problem. My code is below.
Code:
Ext.define('Test.store.Tariff',
{
extend : 'Ext.data.Store',
id : 'Tariffs',
autoLoad : false,
autoSave : false,
autoSync : true,
remoteSort : true,
pageSize : 100,
paramOrder : 'start|limit|page|search',
model : 'Test.model.Tariff',
proxy : {
type : 'direct',
reader : {
type : 'json',
successProperty : 'success',
totalProperty : 'total',
root : 'data',
idProperty : 'Tariff_RowID'
},
writer : {
type : 'json',
encode : false,
writeAllFields : true
},
api : {
create : _tariffHandler.Create_Tariff,
read : _tariffHandler.Load_Tariff,
update : _tariffHandler.Update_Tariff,
destroy : _tariffHandler.Delete_Tariff
},
listeners : {
exception : function(proxy, response, operation)
{
Ext.MessageBox.show(
{
title : 'Remote Exception',
msg : operation.getError(),
icon : Ext.MessageBox.ERROR,
buttons : Ext.Msg.OK
});
}
},
updateCallback: function (request, success)
{
if (!request.operation.success && request.operation.hasException())
{
console.log(request.operation);
Ext.Msg.show(
{
title : 'Tariff Update Error',
msg : request.operation.getError(),
buttons : Ext.MessageBox.OK,
icon : Ext.MessageBox.ERROR
});
}
}
}
});
ASP.Net
Code:
<DirectMethod()> _
<ParseAsJson()> _
Public Function Update_Tariff(ByVal o As JObject) As Tariff
Dim t As Tariff = Nothing
Try
'ASSUME NEXT TWO LINES FAIL AND MOVE TO CATCH AND THROUGH EXCEPTION
t = Newtonsoft.Json.JsonConvert.DeserializeObject(Of Tariff)(o.ToString())
t.Tariff_Update()
Catch ex As DirectException
Throw New DirectException("CUSTOMR EXCEPTION MESSAGE BEING SEND HERE") '<--- CUSTOMR EXCEPTION MESSAGE BEING SENT HERE BUT
End Try
Return t
End Function
It is only error message I keep getting is:
"Error occurred while calling Direct method: Exception has been thrown by the target of an invocation."