Icon Combo
Icon Combo is a combo box with icons appearing adjacent to each list values.
The icons of the list values appear from CSS based configuration.
This combo is suitable only when the list values are definite as it needs the CSS based configuration for icon display.
The icons will appear adjacent to each list values only when there are icon images available for all the list values in the default image folder with proper CSS configuration.
War
- Form Items > Data Selection > Icon Combo.
- You can perform any of the following steps to add values to the Icon Combo:
- Adding values in the form designer
Click the SETTINGS icon in the Icon Combo box. In the pop-up text box, type the values in the following format:
1 (rawkey) : 1 (rawvalue) (for example, 1 : Red)
You can specify multiple values by using comma to separate the values (for example, 1 : Red, 2 : Blue, 3 : Green).
- Only raw values get displayed in the box. The raw keys do not get displayed.
- To indicate no selection for the field, click Include Select Indicator in the SETTINGS pop-up for the Select option to appear at the beginning of the combo list. If you need to change the default select label, refer Changing the Default Select Label in the Drop-Down Fields.
- Click Include All Indicator in the SETTINGS pop-up for the All option to appear at the beginning of the combo list.
- To enable the data to be cached for the Icon Combo, click Cache Data Indicator in the SETTINGS pop-up.
Or
- Adding values through data-support class of the form
Icon Combo allows adding two types of values through data-support class of the Form.
- Pre-Defined data values (See Adding Pre-Defined Data Values)
- Dynamic data values (See Adding Dynamic Data Values )
There might be situation where only single value is populated in the drop-down, in which case it makes sense to have the single value selected automatically instead of prompting users to select it. To achieve this, refer Automatic selection of value when drop-down contains single value.
After creating the class, add the class path of the data support class in Form Designer > Form tab > Data Support Class.
To enable the data to be cached for the Icon Combo, click Cache Data Indicator in the SETTINGS pop-up of the Icon Combo item.
- After configuring the list of values using the data support class, place the icon images for each list values at your default image folder and create a CSS class in the custom.css as shown:
.comboIcon-PARENT_ID-ITEM_ID-LIST_VALUE { background:url('URL of the Image')no-repeattransparent!important; background-color: #FFFFFF!important; background-attachment: scroll!important; background-clip: border-box!important; background-origin: padding-box!important; background-position: 2pxcenter!important; background-repeat: no-repeat!important; background-size: autoauto!important; padding-left: 45px!important; }
Assuming green and red are the list values, the CSS class that you need to add must be as shown:
.comboIcon-UPDATE_PREFERENCE-THEME-green { background:url('../images/color-panel_green.png')no-repeattransparent !important; background-color: #FFFFFF!important; background-attachment: scroll!important; background-clip: border-box!important; background-origin: padding-box!important; background-position: 2pxcenter!important; background-repeat: no-repeat!important; background-size: autoauto!important; padding-left: 45px!important; } .comboIcon-UPDATE_PREFERENCE-THEME-red { background:url('../images/color-panel_red.png')no-repeattransparent !important; background-color: #FFFFFF!important; background-attachment: scroll!important; background-clip: border-box!important; background-origin: padding-box!important; background-position: 2pxcenter!important; background-repeat: no-repeat!important; background-size: auto!important; padding-left: 45px!important; }
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. | FRM_THEME |
2 | Item ID | Unique ID to the Form item. | THEME_ID |
3 | Item Type | To identify the item type in a form. | ICONCOMBO |
4 | Channel | Assigns the form item compatibility for various devices | Desktop / Tablet / Mobile |
5 | Bundle Key | Name of the key associated with the property file which provides the localized label text for the current form item. | common |
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 | THEME | |
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. If 'Mandatory' is already selected, do not select this property. | De-Selected |
18 | Add Icon |
| De-Selected |
19 | 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 |
20 | Clone | Enables you to create a duplicate of the selected form item along with its applicable properties except for the Item ID. | 2 |
21 | 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. |