SmartCLient v 91p
Hi,
I have a ListGrid and I need to perform some custom checks in the DMI before adding a new record.
If the checks fails, I need to add an error message in the DSResponse;
on the client side, the addData()'s callback will show the custom error message.
My js call is like :
DMI server side code is like..:
My problem is that, although on server side the dsResponse is correctly set with the error Status ( STATUS_FAILURE ) and message:
status = -4
errors = [{myError={errorMessage=MyErrorMEssage}}].
These attributes 'disappear' on the client side. In the callBAck function, dsResponse status is : 0 and no error message is present.
Any clue ?
Thx
Hi,
I have a ListGrid and I need to perform some custom checks in the DMI before adding a new record.
If the checks fails, I need to add an error message in the DSResponse;
on the client side, the addData()'s callback will show the custom error message.
My js call is like :
Code:
listgrig.addData(record, function(dsResponse, data, dsRequest){
if (dsResponse.status < 0) {
.... show error message
}else{
....do something
}
},{willHandleError: true});
DMI server side code is like..:
Code:
public Map add(Map record){
Map x = new Map();
DSResponse dsResponse = new DSResponse();
.... perform custum check...
if (..check OK){
...add record
}else{
dsResponse.setStatus(DSResponse.STATUS_FAILURE);
dsResponse.addError("myError", "MyErrorMEssage");
}
return x;
}
status = -4
errors = [{myError={errorMessage=MyErrorMEssage}}].
These attributes 'disappear' on the client side. In the callBAck function, dsResponse status is : 0 and no error message is present.
Any clue ?
Thx
Comment