I wanted to create a custom Validator, that sends an ajax-request. After some validation on the server, the right case should be returned. The problem is, that the ajax-request needs a moment to answer, so that the return is excecuted before the variable could be set. Is there any way, I can avoid or solve this problem.
Code:
isc.Validator.addValidator(
"serversideValidator",
function (item,validator,value) {
var validator_return = null;
isc.RPCManager.sendRequest({
httpMethod: "GET",
useSimpleHttp: true,
evalResult: false,
actionURL:"/ajax/read/2/validator/" + item.name + "/" + value ,
callback:
function (rpcResponse, data, rpcRequest) {
validator_return = false;
if (data == 'true'){
validator_return = true;
}
},
});
if (validator_return!=null){
return validator_return;
}
}
);
Comment