Sep 17, 2012, 1:17 PM
[CLOSED] How to handle the result of DirectMethod?
Hi,
How should I handle the result of a DirectMethod if I need to return some extra parameters to the client? The return type should probably be DirectResponse and then its ExtraParamsResponse property should be set. However, I'm confused by the fact that ExtraParamsResponse is string and not a collection type as in DirectEvents.
Could you please provide a little code sample or an example link how to do this properly?
How should I handle the result of a DirectMethod if I need to return some extra parameters to the client? The return type should probably be DirectResponse and then its ExtraParamsResponse property should be set. However, I'm confused by the fact that ExtraParamsResponse is string and not a collection type as in DirectEvents.
Could you please provide a little code sample or an example link how to do this properly?
<RowSelect Handler="X.DirectMethodTest(param1,
{
eventMask: { showMask: true },
success: function (result) {
var response = result.extraParamsResponse;
// How to retrieve the return parameter??
//var retParam1=response.get('retParam1');
},
failure: function (message) {
Ext.Msg.show({
msg: message,
buttons: Ext.Msg.OK,
title: 'Application Error',
icon: Ext.Msg.ERROR,
closable: false
});
}
});" />
[DirectMethod]
public DirectResponse DirectMethodTest(int param1)
{
// How to set the return parameters properly??
DirectResponse result = new DirectResponse();
string extraParamsResponse="retParam1=1;";
result.ExtraParamsResponse=extraParamsResponse;
return result;
}
Last edited by Daniil; Sep 17, 2012 at 4:20 PM.
Reason: [CLOSED]