Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Replaced 'cbx' prefixed events with Canvas Constants.

...

#

Form Item Handlers

Description

1

cbxchangeCHANGE

Syntax:

Code Block
languagejs
this.fm.registerHandler("cbxchange", CFEC.CHANGE,"<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.

2cbxclick

CLICK

Syntax:

Code Block
languagejs
this.fm.registerHandler(
"cbxclick"
CFEC.CLICK, "<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

cbxafterselectAFTER_SELECT

Syntax:

Code Block
languagejs
this.fm.registerHandler("cbxafterselect"CFEC.AFTER_SELECT, "<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.
The component sends the selected record JSON object for the app layer to extract the data needed for populating the related fields.

4

cbxbeforeloadBEFORE_LOAD

Syntax:

Code Block
languagejs
this.fm.registerHandler("cbxbeforeload"CFEC.BEFORE_LOAD, "<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

cbxclearlookupCLEAR_LOOKUP

Syntax:

Code Block
languagejs
this.fm.registerHandler("cbxclearlookup"CFEC.CLEAR_LOOKUP, "<LOOKUP_ID>", 
function(fm, event, fieldName, value) 
{ 
   //Developer to perform operations here. 
});


This event is fired when the lookup item is cleared.

6

cbxdateclearDATE_CLEAR

Syntax:

Code Block
languagejs
this.fm.registerHandler("cbxdateclear"CFEC.DATE_CLEAR, "<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

cbxvalidateVALIDATE

Syntax:

Code Block
languagejs
this.fm.registerHandler("cbxvalidate"CFEC.VALIDATE, "<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

cbxbeforetabchangeBEFORE_TAB_CHANGE

Syntax:

Code Block
languagejs
this.fm.registerHandler("cbxbeforetabchange"CFEC.BEFORE_TAB_CHANGE, "<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

valuechangeVALUE_CHANGE

Syntax:

Code Block
languagejs
this.fm.registerHandler("valuechange"CFEC.VALUE_CHANGE, "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.
The code provided on the left column is for a scenario when the developers want to change the text case as it is being typed from lowercase to uppercase.

...