Lookup
Lookup is a text field that allows searching and selecting the data within a widget which is likely to be the input.
Editable lookup feature also allows you to filter the data for the pre-configured (DS_KEY COLUMN) column in the lookup search widget. The value in the search column will filter only the column where the search value is listed.
The filter can be applied only to column which contains string.
For the selected data to be populated in the text box, JavaScript has to be manually coded in the Form listener.
For Example:
this.fm.registerHandler(CFEC.AFTER_SELECT, "LOOKUP", function(fm, event, fieldName, record) { fm.model.setValue("LOOKUP", record.VALUE1); });
Lookup is not available in JQuery Mobile.
- Form Items >Data Selection>Lookup.
- You can select a widget from the list of widgets that display after you click the Lookup form item.
You can only select one widget at a time.
To change the widget, click the SETTINGS icon.
Adding a template for Lookup form item
To add a template for the Lookup form item, you have to specify the JSON structure of the single-click selection for the selected lookup form item along with the appropriate template ID in the APPLICATION_CONFIG column present in the FORM_ITEM_DEFINITION table in the Canvas schema. You must use the relevant template ID to specify the appropriate template which needs to be added to the selected lookup form item. The following code snippet serves as a sample reference:
{ "enableSingleClk":true, "returnRowData":true, "selectedTemplateUrl":"NEWTEMPLATE" // The template ID is NEWTEMPLATE }
The sample DB entries to be provided in the FORM_ITEM_DEFINITION table for adding a template to the Lookup form item are listed as follows:
In the following example, the provided DB entries are associated with the MySQL database. However, the following listed DB entries are applicable for other databases like Oracle, Postrgre and MSSQL.
Column Names | Column Values |
---|---|
APPLICATION_ID | MODELHOUSE |
FORM_ID | NEW_FORM |
ITEM_ID | LOOKUP |
PARENT_ID | NEW_FORM |
POSITION | 1 |
ITEM_TYPE | 20 |
DISPLAY_NM_KEY | (NULL) |
PLAIN_LBL | Lookup Field |
LAYOUT | (NULL) |
ANCHOR | 100 |
BUNDLE_KEY | common |
MIN_LENGTH | (NULL) |
MAX_LENGTH | (NULL) |
MAX_NUM_LINES | (NULL) |
MAX_CHAR_PER_LINES | (NULL) |
TOTAL_COLS | (NULL) |
ROW_SPAN | (NULL) |
COL_SPAN | (NULL) |
VALIDATION_TYPE | (NULL) |
RAW_KEYS | (NULL) |
RAW_VALUES | (NULL) |
INCLUDE_SELECT_IND | (NULL) |
CONTAINER_IND | (NULL) |
VISIBLE_IND | Y |
EDITABLE_IND | Y |
READ_ONLY_IND | N |
REQUIRED_IND | N |
LOOKUP_IND | Y |
COLLAPSIBLE_FIRST_IND | (NULL) |
DS_VIEW_IND | (NULL) |
DS_KEY_COLUMN_ID | (NULL) |
DS_VAL_COLUMN_ID | (NULL) |
WIDGET_ID | BENEFICIARIES |
CONDITIONAL_IND | N |
CACHE_DATA_IND | (NULL) |
VALIDATE_ON_SWITCH_IND | (NULL) |
CRITERIA_ID_REQ_IND | (NULL) |
CONTEXT_CONTAINER_IND | (NULL) |
HIDE_LABEL | N |
MULTI_LANG_IND | N |
UPLOAD_FILE_FORMATS | (NULL) |
RESIZABLE_IND | N |
LINKED_CURR_COL | (NULL) |
LABEL_ALIGN_TYPE | top |
APPEND_CURRENCY_MODE | (NULL) |
INITIAL_MULTIPLICITY | (NULL) |
PRINT_REQUIRED_IND | Y |
TOGGLE_IND | (NULL) |
CHANNEL_ID | A |
LABEL_CHAR_COUNT | (NULL) |
HELP_ICON_IND | N |
COPY_PASTE_IND | (NULL) |
PRODUCT | (NULL) |
SUB_PRODUCT | (NULL) |
FUNCTION_CODE | (NULL) |
INPUT_ACTION | (NULL) |
APPLICATION_CONFIG | { "enableSingleClk":true, "returnRowData":true, "selectedTemplateUrl":"NEWTEMPLATE" } |
EVENT_CONFIG | (NULL) |
VALIDATION_CONFIG | (NULL) |
LOV_CATEGORY | (NULL) |
LOV_PARENT_ID | (NULL) |
LST_UPD_DT | 2021-10-11 15:42:52 |
The following table provides information about the properties that are applicable to the Lookup form item:
# | Property | Description | Sample Value |
---|---|---|---|
1 | Form ID | Unique ID of the Form on which you want to place the Form Item. | FORM_PAYMNT_CRMCQ |
2 | Item ID | Unique ID to the Form item. | INPUT_ACC_NO |
3 | Item Type | To identify the item type in a form. | LOOKUP |
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. | 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 | ACCOUNT NO | |
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 | By making use of Add Icon option, you can add an icon to the form item. Perform the following steps for adding an icon to a form item:
| Selected |
19 | Multilingual input allowed | Selected: Supports the multilingual characters to be entered into the form items. | De-Selected |
20 | 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 |
21 | Clone | Enables you to create a duplicate of the selected form item along with its applicable properties except for the Item ID. | 2 |
22 | Full Screen Indicator | Selected: Displays the look up window in full screen. | De-Selected |
23 | Widget ID | Displays the Widget ID selected for the Lookup form item. | De-Selected |
24 | 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. |