Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »


Canvas provides the following event handlers to manage the Form actions:

#

Form Event Handlers

Description

1

this.fm.registerHandler("cbxpreinitialize", function(fm, params)

{
    return params;
});

This event is called before the Form Manager initiates the form creation. The handler of this event is expected to return a config object. The returned object configuration is given priority over the default metadata configuration or the view mode of the form.

2

this.fm.registerHandler("cbxpremodelload", function(fm, params)

{

    return params;
});

This event is called before the Form Manager makes its request for loading the model data. The handler of this method is expected to return a Boolean flag for continuing the model AJAX call or a JSON containing all the base params needed to be sent to the server.

3

this.fm.registerHandler("cbxpostmodelload",function(fm,data){
   return

     {

       };

});

This event is raised by the Form Manager after the successful retrieval of data server. This event can be used for massaging the received data as per the form structure. The handler returns the data in JSON format.

4

this.fm.registerHandler('cbxprevalidate', function (fm, data)

{
   return [true,true];
});

This event handler can be used to override the framework's default validation logic for validating the entire form. The handler is expected to return value in the array of Boolean (true/false) as the validation result.
This point-cut is used for performing validation on conditional mandatory fields.

5

this.fm.registerHandler("cbxpostvalidate", function(fm,config)
{

    return config.isDefaultValid;
});

This event handler is called after the default validation process is executed. The handler is expected to return a Boolean flag where, true is for valid and false is for invalid form.

  • No labels