Canvas provides the following event handlers to manage the Form Item actions.
# | Form Item Handlers | Description |
---|---|---|
1 | cbxchange Syntax: this.fm.registerHandler("cbxchange", "<FORM_ITEM_ID>", function(fm, event, fieldName, value) { //Developer to perform operations here. }); | This event handler is executed every time its associated field value gets changed. |
2 | cbxclick Syntax: this.fm.registerHandler("cbxclick", "<FORM_BUTTON/HYPERLINK_ID>", function(fm, event,fieldName) { //Developer to perform operations here. }); | This event is raised on click event of the button or hyperlink item. |
3 | cbxafterselect Syntax: this.fm.registerHandler("cbxafterselect", "<LOOKUP_ID>", function(fm, event, fieldName, value) { //Developer to perform operations here. }); | This event is raised for the Lookup items when the user selects a record within the data list presented in the pop-up. |
4 | cbxbeforeload Syntax: this.fm.registerHandler("cbxbeforeload", "<LOOKUP_ID>", function(fm, event, fieldName) { //Developer to perform operations here. //return parameters }); | This event is raised by the lookup before it creates its data load request. The app layer is expected to return a param JSON that is attached to override the existing base params of the lookup. |
5 | cbxclearlookup Syntax: this.fm.registerHandler("cbxclearlookup", "<LOOKUP_ID>", function(fm, event, fieldName, value) { //Developer to perform operations here. }); | This event is fired when the lookup item is cleared. |
6 | cbxdateclear Syntax: this.fm.registerHandler("cbxdateclear", "<FORM_DATEFIELD_ID>", function(fm, event, fieldName, value) { //Developer to perform operations here. }); | This event is fired when the date field of a form is cleared. |
7 | cbxvalidate Syntax: this.fm.registerHandler("cbxvalidate", "<FORM_ITEM_ID>", function(fm, event, fieldName, value) { //Developer to perform operations here. }); | This event handler is fired every time its associated field value changes before its value is set to the model for update. The handler is expected to invalidate the field if necessary and return true or false. In case of false, the model data is not updated with the same value. |
8 | cbxbeforetabchange Syntax: this.fm.registerHandler("cbxbeforetabchange", "<FORM_ITEM_ID>", function(fm, event, fieldName, value) { //Developer to perform operations here. }); | This event is fired by the Tab Panel when the user tries to switch between two tabs. The handler is expected to return Boolean value to allow or stop the switch. |
9 | valuechange Syntax: this.fm.registerHandler("valuechange", "FORM_ITEM_ID", function(fm, event, fieldName, value) { fm.model.setValue('FORM_ITEM_ID', value.toUpperCase()); }); | This event handler is fired to capture and raise the event when the user is changing/entering the value in the field. |