Auto Suggest

Auto Suggest is a field that auto-fills the values based on the user input with the pre-configured values. This item is a combo box but without the drop-down icon for data selection.


  • Form Items >Data Selection>Auto Suggest.




Click the SETTINGS icon of the Auto Suggest item. In the pop-up text box, type the values in the following format:
1 (rawkey) : 1 (rawvalue) (for example, 1 : Yes)
You can specify multiple values by using comma to separate the values (for example, 1 : YES, 2 : NO, 3 : MAYBE).

  • Only raw values get displayed in the box. The raw keys do not get displayed.
  • To select a view, click View ID lookup and select the view type of your choice. 
  • In the Key Column field, enter the column ID from the selected view that stores the value selected in back-end.
  • In the Value Column field, enter the column ID from the selected view that displays the value in the Combo drop-down.
  • In the LOV Category field, specify the LOV (List of Values) Category. 
  • In the LOV Parent ID, specify the Parent ID of the selected LOV (List of Values) Category.
  • Click Include All Indicator in the SETTINGS pop-up for the All option to appear at the beginning of the combo list.

OR

  • Adding values through data-support class of the form

Auto Suggest allows adding two types of values through data-support class of the Form:

1. Pre-Defined data values (See Adding Pre-Defined Data Values)

2. 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.

  • Enabling templates in the AutoSuggest form item

                For enabling templates in the AutoSuggest form item, you must add the list (TEST_AUTOSUG_LIST_TEMP.cttpl), static (TEST_AUTOSUG_STATIC_TEMP.cttpl)  and view 

                (TEST_AUTOSUG_VIEW_TEMP.cttpl) template files in your application WAR folder.

It must be ensured that the list, view and static template files added to your application WAR folder must be in the CTTPL format. 

                To enable templates in the AutoSuggest form item, specify the template selection property in the form's listener file as shown in the following code snippet:

//Applying modalDialog to all dialog modals
ct.Window = ct.modalDialog;
ct.Dialog = ct.modalDialog;
iportal.Window = ct.modalDialog;
iportal.Dialog = ct.modalDialog;

// Show hide menu to displayed in all grids
ct.env.options.widget.showHideMenu=true;

//TODO add any over rides to CANVAS global properties

canvas.ns("canvas.form.listeners");
canvas.form.listeners.testFrm = Class(canvas.Observable, {
	constructor: function(config) {
		this.fm = config.fm;
	},
	registerHandlers: function() {
		
		this.fm.registerHandler(CFEC.PRE_INITIALIZE, function(fm) {
            return {
				'AUTOSUGGEST_FIELD': {
					templateUrl: 'TEST_AUTOSUG_LIST_TEMP.cttpl', //template url beginning after the implementation template path
					selectedTemplateUrl: 'TEST_AUTOSUG_VIEW_TEMP.cttpl', //template url beginning after the implementation template path
					staticTemplateUrl: 'TEST_AUTOSUG_STATIC_TEMP.cttpl', //template url beginning after the implementation template path					
					displayKeys:['accno','name'], //properties of the value object to be shown as the selected value
					displayKeysSeparator: '-', //separator to concatenate the display keys
					showTemplateOnSelect: true, //Enables template selection
					enableSearch: false //Enables to perform a search for template selection
				}
            };
		});
		this.fm.registerHandler(CFEC.POST_FORM_RENDERER, function(fm) {
            fm.updateComboRawStore('AUTOSUGGEST_FIELD', ['123601602456','638868965990','688598760238'], [{name:'Anthony Lane',accno:'123601602456',acctype:'Personal Banking',imgurl:'images/bank_logo/andhra-bank1.png'},{name:'Gadzhi Kharkharov',accno:'638868965990',acctype:'Corporate Account',imgurl:'images/bank_logo/axis-bank.png'},{name:'Marcello Manso',accno:'688598760238',acctype:'Credit card',imgurl:'images/bank_logo/icici-bank.png'}]); //The form item ID is AUTOSUGGEST_FIELD
			
		});
	}
});
CFLR.registerListener("ACCOUNTS_FORM", canvas.form.listeners.testFrm); //The form ID is ACCOUNTS_FORM


                To enable the styles for the applied template in the AutoSuggest form item, specify the appropriate CSS styles in the primary-jqtbs-ltr.scss file present in your application WAR folder,

                as shown in the following code snippet:

.inview {
background-color: #a8d4ff;
}

.static {
background-color: #d1d1d2;
}


To display the number of suggestions for the list of values configured for the AutoSuggest form item to reflect globally at the application level, ensure that you specify the env option for displaying the number of suggestions associated with the configured list of values for the AutoSuggest form item in the form's listener file and you can provide a number of your choice to be displayed as suggestions in AutoSuggest form item, as shown in the following code snippet:

ct.env.options.form.autosuggest.noOfSuggestions = 7 // Here, 7 indicates the number of suggestions to be displayed as the list of values for AutoSuggest.    



The following screen shot showcases the number of list values configured for the AutoSuggest form item in the functional application, Modelhouse:


The following screen shot serves as a good illustration of the AutoSuggest form item with the applied template in the functional application, Modelhouse: 



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.

CHQ_REQ_FORM

2

Item ID

Unique ID to the Form item.
This value is automatically configured once the form is selected from the pop-up window.

DELIVERY_MODE

3

Item Type

To identify the item type in a form.

AUTO_SUGGEST

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.
Form item bundle key supersede the form level bundle key. If this value is blank, form level bundle key will be used to find label keys.


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.
See About Display Name Key and Plain Label till 18.1 for more details about this property and the related conditions.

Display Name Key is the property-driven label key for the form item. 
See About Display Name Key and Plain Label till 18.1 for more details about this property and the related conditions.

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

DELIVERY MODE

8

Edit

Selected: Renders the Form in edit enabled mode.
De-Selected: Renders the Form in edit disabled mode.

Selected

9

Visibility

Selected: Shows the form item on the Form.
De-Selected: Hides the form item from the form, but the data will still be in active.

Selected

10

Help

Selected: Renders the form item with a help icon.
De-Selected: Renders the form item without a help icon.
Refer the Configuring Help Messages and Tooltips for Form Items section for more information on configuring help text.

Selected

11

Anchor

Defines the size of the form item in terms of percentage (without % symbol).

50

12

Print

Selected: Allows printing the form item while printing the form.
De-Selected: Does not print the particular 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.
Select Options: Left () or Top () or Inline ()

Top

15

Hide Label

Selected: Hides the label of the form item.
De-Selected: Shows 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.
De-Selected: Considers the particular field as non-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

18Add 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: 

  1. Clickicon to add an icon to the field. By default, the Left option gets selected, which paves the way for the icon to get placed on the left side of the form item's label, whereas if the option Right is chosen, then the icon gets placed on the right side of the form item's label. 

  2. Clickicon to choose an icon for the form item. 


  3. Icons and Custom are the two available tabs. From the list of icons in Font Awesome, you can choose an icon of your choice. Click Search text field and type the name of the icon, which you wish to choose. 


  4. Default, Active, Disabled and Error are the four available options, categorized under the field, Choose icons for different state. You can assign separate icons for the four different states of Default, Active, Disabled and Error. Default indicates the default icon of the form item, whereas Active and Disabled depict the active and disabled states of the form item. When the selected form item is active, the chosen icon for Active state gets displayed and similarly, the icon, chosen for Disabled state, gets displayed, if the form item is in a disabled state. When an error occurs, the icon, which was selected for Error, gets displayed. 


  5. To add a customized icon, click Custom tab. 


  6. Click Browse Files button to select an image from your local drive. You can even drag and drop the customized image file directly, without any fuss. 


    The customized image appears under the category of Custom Images.  

    If you upload a customized icon for the form item, ensure that you restart the app server, after saving the form. Make sure to log out from Canvas Studio and close the Studio application, before restarting the app server. If you do not restart the app server, the uploaded custom icon will not appear as the assigned icon for the selected form item.




Selected
19

Multilingual input allowed

Selected: Supports the multilingual characters to be entered into the form items.
De-Selected: Supports only the default language (English).

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:

  1. Select the form item in the form designer area.
  2. Click the Switch icon ( ) on the primary ribbon.
  3. Select another form item to switch the existing form item.

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

22Event 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.