08-05-2014 08:35 AM
Alfresco.forms.validation.checkNumber = function checkNumber(field, args, event, form, silent, message) {
//get actual value
var billYear = field.value;
var scriptURL = Alfresco.constants.PROXY_URI + "someco/Exists.json?billYear=" + billYear;
var valid = false;
// check if exists
Alfresco.util.Ajax.jsonGet({
url: scriptURL,
scope: this,
successCallback: {
fn: function handleInfo(obj) {
if(obj.json.result.toString() == "true") {
valid = false;
} else {
valid = true;
}
return valid;
},
scope: this
},
failureCallback: {
fn: function(obj){
valid = false;
},
scope: this
}
});
return valid;
};
08-06-2014 02:14 AM
08-07-2014 08:55 AM
setTimeout
and in that function return true
, checkNumber(){}
is acting like it has no return value so it return false
.onchange()
event, but I am not sure if it is good aproach.Alfresco.forms.validation.checkNumber = function checkNumber(field, args, event, form, silent, message) {
setTimeout(function(){ return true;}, 1000);
};
08-08-2014 12:50 AM
08-08-2014 03:59 AM
false
. Probably I will solve it by different way. I will add new atribute to that input which will be validated. This atribute contain restricted values and this values will be reffiled at time of creation of input and at keyup event. Then validator will only parse this atribute and validate by that.11-30-2015 05:14 PM
share-config-custom.xml
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.