CAF UI question

Hi all,

I am new to webMethods development and I have a question that is bugging me for some time. When an error appears on the page due to a webMethods provided validator the error appears both bellow the problematic field and also if trying to go elsewhere, let’s say clicking on a command button the error will appear in a blue modal window which is kind of annoying. Is there any way to prevent the modal window to appear. The users see the same error in 2 different ways and can get confused.

Thank you very much.

I’ve attached a screenshot for the problem.

I think you have placed your text control inside a property line.
The validation message generally appears below the control whenever the control is placed inside a property line.
Please use static rows and static cells for formatting the page.


The validation popup dialog comes from the CAF.ErrorHandler.handleFormValidationError function. See:!s!handleFormValidationError

You can override that function if you want to suppress the popup dialog for specific forms.

For example, you could put something like this in a script block control for your portlet:

if (!window.customFormValidationErrorHandler) {
    var originalFn = CAF.ErrorHandler.handleFormValidationError;
    window.customFormValidationErrorHandler = function(forms, msg) {
        var formId = '#{caf:cid("defaultForm")}';  //the id of the form to suppress the popup for
        if (forms && forms.indexOf(formId) != -1) {
           //suppress the popup for this form
        } else {
           //fallback to the original handler for other forms
           originalFn(forms, msg);

//swap out the function with our custom one.
CAF.ErrorHandler.handleFormValidationError = window.customFormValidationErrorHandler;