This commit is contained in:
2019-11-26 00:35:25 +00:00
parent 2a17ffd35a
commit 4c667b39a2
4 changed files with 38 additions and 12 deletions

View File

@@ -52,6 +52,7 @@ function getControl(vm, ref) {
var customFields = vm.$refs["customFields"];
if (customFields !== undefined) {
ctrl = customFields.$refs[ref];
}
}
@@ -71,20 +72,28 @@ function getControl(vm, ref) {
//
function getControlValue(ctrl) {
var value = ctrl.value;
// if(value==undefined){
// debugger;
// if(ctrl._props){
// var subvalue=ctrl._props;
// }
// }
return value;
//vm.$refs["customFields"]._computedWatchers.c2.value
}
////////////////////////////////////
// Get field name from control
//
function getControlLabel(ctrl) {
// if (window.$gz.errorHandler.developmentModeShowErrorsImmediately) {
// if (!ctrl.label) {
// debugger;
// throw "gzform:getControlLabel - the control has no label " + ctrl;
// }
// }
return ctrl.label;
if(ctrl.label==undefined){
return "UNKNOWN CONTROL";
}else{
return ctrl.label;
}
}
/////////////////////////////////////////
@@ -142,14 +151,20 @@ function getErrorBoxErrors(vm, errs) {
}
export default {
todo: make a customFieldsCheck() rule, see todo.txt top item under "now"
///////////////////////////////
// REQUIRED
//
required(vm, ref) {
required(vm, ref, subvm) {
if (vm.formState.loading) {
return false;
}
//debugger;
if(subvm){
debugger;
console.log("gzform:required() being called from custom fields control: ref=" + ref + " customFields value = " + vm.$refs.customFields.value);
}
var ctrl = getControl(vm, ref);
if (typeof ctrl == "undefined") {
return false;
@@ -159,6 +174,7 @@ export default {
if (!isEmpty(value)) {
return false;
}
// console.log("gzform:required() -> Control " + ref + " is empty! returning errror");
// "ErrorRequiredFieldEmpty": "{0} is a required field. Please enter a value for {0}",
var err = window.$gz.locale.get("ErrorRequiredFieldEmpty");