Bean shell validator error message in form grid

Confluence User - 14 Jul, 2017

Good afternoon. We are testing a validation by using BeanShell on a FormGrid. The validation is done correctly, however, we have not been able to show the error message. The final section of the code we implement is the following:

 if (total < trvelers ) {
            String id = FormUtil.getElementParameterName(element);
            formData.addFormError(id, "SHOW ERROR SHOW ERROR SHOW ERROR");
            result = false;
        }
    }
  
    return result;
}
//call validate method with injected variable
return validate(element, rows, formData);

Something is missing? When we run it in a real test the system only shows us "Validation error" at the top of the form but does not show us the error specification in the form grid element

form;grid;validation;beanshell

1


14 Jul, 2017
confluenceUser
confluenceUser

Hi, I just tried a simple piece of validation on a form grid

import org.joget.apps.form.service.FormUtil;
String id = FormUtil.getElementParameterName(element);
formData.addFormError(id, "CUSTOM ERROR");
return false;

and the error shows up fine. You might want to check the logs to see if there is any syntax or runtime error in your code.

 

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print