M
Mohammed Siraj
Guest
For each field in an Object Record form (New/Edit/Status-Change/QuickCreate page), users can now acccess a FieldContext object using client-side API function rbf_getFieldContext(fieldIntegrationName). Eg: var fieldContext = rbf_getFeildContext('fieldA'); This field context object will encapsulate state & behavior details for the given field. FieldContext object interface details: State: getNode(): Will return jquery object for the HTML control (input,select,textarea etc.). This will execute faster when compared to running a jquery selector (eg. $("input[name='textA']")) against the complete page DOM, as the jquery node reference is part of FieldContext object state. getKendoConfig(): Will return kendo configuration object for this field (only if the field is a kendo control). This function should be preferred to access kendo configuration object for a field, instead of $("input[name='feildA']").data('kendoDropdownList'). It will execute faster as the kendo configuration object is part of field context state. Also, it does not impose any requirement on User to have knowledge of the specific kendo control type i.e. kendoNumericTextbox or kendoDropdownList or kendoMultiSelect. There will also not be any compatibility issues across releases if user comes through these Rollbase provided wrapper API's instead of directly working against the page DOM. getFieldType(): Will return a string identifier for the field type i.e. 'IntInput' for all Integer fields & similar. getFormNode(): Will return jquery node reference for the form element in page DOM. getContainer(): Will return jquery object for the root container element that holds this field control & all related DOM elements like validation . Behavior: validate(): Will run client-side validations against the field. enable(isEnabled): Toggle functionality to enable/disable a field. show(): Will show the field. hide(): Will hide the field. focus(): Will give focus to the field. isRequiredField(): Will return boolean TRUE if the field is marked as a 'required' form field. getValue(): Will return the field's current value. setValue(value): Will set the field's value as per the passed argument. addOnChangeHandler(handlerFunc): Will add a change handler for the field. /** Available from Rollbase 4.0.5 onwards */ Additionally, for specific field types, we have additional interface methods as part of the field context object eg. setPicklistCode for Picklist fields. Will share them individually as specific to each field type. Note: This API is specific to New UI pages.
Continue reading...
Continue reading...