Slider Field form item allows you to select a numeric value from a defined set of possible values.
- Form Items > Data Selection > Slider Field:
- You can increase the number of thumbs for the slider field. Increasing the slider thumbs enables you to select a range of values.
APIs:
- To create slider thumbs dynamically
Sample code to create more than one slider thumb in the slider component is as follows:
fm.createSliderThumbs("ITEM_ID","3"); /* Here, * 'fm' refers to the form manager's object. * 'createSliderThumbs' is the API for dynamically adding the thumbs for slider. * 'ITEM_ID' is the unique ID given to the slider. * '3' refers to the number of thumbs for the slider. */
- To set the minimum range dynamically
Sample code to set the minimum range for the slider component is as follows:
fm.setMinValue("ITEM_ID","500"); /* Here, * 'fm' refers to the form manager's object. * 'setMinValue' is the API for dynamically set the minimum range. * 'ITEM_ID' is the unique ID given to the slider. * '500' refers to the number of thumbs for the slider. */
- To set the maximum range dynamically
Sample code to set the maximum range for the slider component is as follows:
fm.setMaxValue("ITEM_ID","10000"); /* Here, * 'fm' refers to the form manager's object. * 'setMaxValue' is the API for dynamically set the maximum range. * 'ITEM_ID' is the unique ID given to the slider. * '10000' refers to the number of thumbs for the slider. */
- To set the maximum range on form initialization
Sample code to set the maximum range for the slider component on form initialization is as follows:
this.fm.registerHandler("cbxpreinitialize", function(fm, event, fieldName, value) { return { 'ITEM_ID': { 'setMaxValue' : 10000 } } } /* Here, * 'fm' refers to the form manager's object. * 'cbxpreinitialize' is the event for form pre-initialization. * 'ITEM_ID' is the unique ID given to the slider. * 'setMaxValue' is the API for dynamically set the maximum range. * '10000' refers to the number of thumbs for the slider. */
The following table provides information about the properties that are applicable to this form item:
# | Property | Description | Sample Value |
---|---|---|---|
1 | Form ID | Unique ID of the Form on which you want to place the Form Item. | FORM_PURCHINVOICE |
2 | Item ID | Unique ID to the Form item. | AMT_INVOICE |
3 | Item Type | To identify the item type in a form. | |
4 | Channel | Assigns the form item compatibility for various devices. | All Devices |
5 | Bundle Key | Name of the key associated with the property file which provides the localized label text for the current form item. | payments |
6 | Plain Label | Text entered in Plain Label field appears as the label of the form item without the resource bundle key translation. 18.1: If you are using the property files, leave the Plain Label field as blank. Display Name Key is the property-driven label key for the form item. 19.1: In Canvas 19.1, the Display Name Key field is a configuration-driven label key for the form item. See About Display Name Key and Plain Label from 19.1 and Managing Display Names for Forms for more information. | |
7 | Display Name Key | Amount (in Lakhs) | |
8 | Edit | Selected: Renders the Form in edit enabled mode. | Selected |
9 | Visibility | Selected: Shows the form item on the Form. | Selected |
10 | Help | Selected: Renders the form item with a help icon. | Selected |
11 | Anchor | Defines the size of the form item in terms of percentage (without % symbol). | 50 |
12 | Selected: Allows printing the form item while printing the form. | Selected | |
13 | Column Span | Occupies the specified number of item spaces horizontally for the current item. | 1 |
14 | Label Alignment | Indicates the alignment of the labels of the form items. | Top |
15 | Hide Label | Selected: Hides the label of the form item. | De-selected |
16 | Mandatory | Selected: Shows the red asterisk ({}{*}) on the label of the form item, and converts the particular field as mandatory. | Selected |
17 | Conditional Mandatory | Selected: Shows the blue double asterisks ({}{}) on the label of the form item, and converts the particular field as conditional mandatory. If selected, write the conditional logic in the CFEC.PRE_VALIDATE event. See Form Item Handlers for more information. De-Selected: considers the particular field as normal. | De-Selected |
18 | Add Icon |
| Selected |
19 | Minimum Input Size | Indicates the minimum number of characters within the text controls. | 6 |
20 | Maximum Input Size | Indicates the maximum number of characters within the text controls. | 8 |
21 | Switch | Enables you to switch from one form item to another form item along with the applicable properties and their values. To switch from one form item to another form item, execute the steps that follow:
| NA |
22 | Clone | Enables you to create a duplicate of the selected form item along with its applicable properties except for the Item ID. | 2 |
23 | Event Wiring | The Event Wiring option enables you to assign various events for different set of actions. For detailed information on Event Wiring, refer Form Items Event Wiring. |