Prefix Input Field

This post is referring to Vahana 2 (beta version). To check the document for production, please go to vDesigner-v1.0

The Prefixed Input Field element contains two adjoining boxes. The left box contains the prefixed value and the right box contains a value.

You can use the Prefix Input Field element when you want the user to enter the value after the prefix value. For instance:- you can use the Prefix Input Field element to get the mobile number from the end-user. In the Prefix Input Field, the user enters the mobile number in the right box based on the country code, while the left box displays the country code (for example, 91).

Apart from getting the mobile number, you can use the Prefix Input Field in several use cases. Like in other elements, you can display the value in the Prefix Input Field element as follows:

  • By using the Static function
  • By using JSON object/entity

Usage

When to use
You can use the Prefix Input Field element when:
1. You want to display a pair of values (for example, Mr. or Miss. <<Person’s Name>>)
2. You want to take the input from the user after the prefix value
3. You want to display a value with the unit, currency, etcetera

Prefix Input Field Configuration

The Prefix Input Field element contains the following segments to configure different properties:

  • UI Configuration
  • Data Configuration
  • Security Configuration
  • Event Configuration

UI Configuration

For the Prefix Input Field element, you can configure the following UI (User Interface) properties:

TabProperty NameDescriptionMandatoryNew Default ValuesVisibility Rules
BasicReference NameSpecifies a unique name of the element. At the application level, an element is identified and managed by the reference name.YesPrefixInputField_XXXX
BasicLabelIn this box, you can enter the label or title of the element. The application displays the label name above the element.NoLabel
BasicPrefix TextIn this box, enter a numeric or alphanumeric value. At the run time, the element displays this static value as a prefix value in the left box.No
BasicPrefix KeyIn this box, you configure the prefix value as follows:
<<To be discussed>>
No
BasicInput Field KeyIn this box, you configure the input field’s value.
<<To be discussed>>
No
BasicInput TypeIn this list, select a specific data type of the value that the user can enter in the input field.

To define a input data type, you can select one of the following options:

1. Alphabet:- Select it to allow the user to only enter alphabets.

2. Number:-Select it to allow the user to only enter numbers in the input field.

3. Alphanumeric:- Select it to allow the user to enter alphanumeric value, including numbers and alphabets.

4. Regex:-Select it to define a regular expression. To know more about regular expression, see the section: Configuring Regex.

5. Formatter:- Select it to define user-defined input format. To know more about formatter, see the section: Configuring Formatter.
NoAlphabet
BasicAphabet CaseIn this list, you can select one of the following options:
–> Upper Case:-
Select this option to enter capital characters in the element.

–> Lower Case:-
Select this option to enter small characters in the element.

–> Any Case:-
Select this option to enter the small and capital characters in the element.
NoUpper Case
BasicSpecial CharacterIf this check box is selected, you can enter the special character in the element.NoSelected
BasicVisibleIf this check box is selected, the user can see the element on the page.NoSelected
BasicBusiness RuleClick this list and then select a pre-defined business rule that will determine the element’s visibility. If the user’s action satisfies the condition in the business rule, the application will display or hide the element.

To define a njew business rule, access the Business Rule Manager module.
No
BasicEnableIf this check box is selected, the end-user can perform the function on the element.NoSelected
BasicBusiness RuleClick this list and then select a business rule to make the element active or inactive. If the user’s action satisfies the condition in the business rule, the application will make the element active or inactive in the application.

To define a njew business rule, access the Business Rule Manager module.
No
BasicMandatoryIf you click to select this check box, the user needs to enter the value in the element mandatorily. If the user does not enter the value in the element, the application will display the error.NoClear Check box
BasicMessage On MandatoryThis property comes into view when you click the Mandatory check box. In the Message on Failure box, enter the error message that the application will display if the user does not perform the function on the element.NoRequiredIf the Mandatory check box is selected.
BasicPrefix SeparatorIf you click to select this check box, the element displays an edge between the prefix box and the right input box. NoSelected Check box
StyleStylesAllows you to select a specific style for the element from the list of pre-defined styles. The vDesigner module offers pre-defined styles that you can apply to the element.NoDefault
Style-BackgroundColorAllows you to define the background color of the element. Click the left box to display the color canvas.
On the canvas:
1. On the horizontal bar, move the circle to select the color.
2. In the canvas, move the circle to select the tone of the color.
No#FFFFFF
Style-Alignment and SpacingMarginAllows you to desirably define margin around each side of the element. It provides four different boxes to define the margin outside the right, left, top, and bottom border of the element.No4, 4, 4, 4
Style-Alignment and SpacingElement’s AlignmentThis property contains three tabs. You can use these tabs as follows:
1. Left:- By default, this tab is selected. It aligns the element to the left of the page.
2. Center:- If you select this tab, it aligns the element at the center of the page.
3. Right:- If you select this tab, it aligns the element to the right of the page.
NoLeft
Style-LabelFontClick this list to select the font type (For example: – Arial) of the element’s caption.NoOpen Sans
Style-LabelSizeIn this box, enter the font size of the element’s caption’s character in pixels.No14
Style-LabelColorAllows you to define the color of the element’s caption’s character. Click the left box to display the color canvas.
On the canvas:
1. On the horizontal bar, move the circle to select the color.
2. In the canvas, move the circle to select the tone of the color.
No#6F6F6F
Style-LabelWeightIn this box, enter a value in the range from 1 to 9. This value specifies the thickness of the element’s caption’s character.No4
Style-LabelStyleClick this list to select the style of font (For example:- Italic) of the caption.NoNormal
Style-LabelLine HeightIn this box, enter a numeric value in pixels (for example:- 18). This value specifies the character’s height in the element’s title.No18
Style-LabelLetter SpacingIn this box, enter a numeric value in pixels (for example:- 2). This value specifies the space between characters in the element’s title.No0
Style-PlaceholderTextIn this box, enter the hint text (for example:- Please enter your mobile number). The placeholder text (hint) helps the user perform the function on the element.No
Style-Placeholder
SizeIn this box, enter the font size of the element’s placeholder’s character in pixels.No14
Style-PlaceholderColorAllows you to define the color of the element”s placeholder’s character. Click the left box to display the color canvas.
On the canvas:
1. On the horizontal bar, move the circle to select the color.
2. In the canvas, move the circle to select the tone of the color.
No#6F6F6F
Style-PlaceholderLetter SpacingIn this box, enter a numeric value in pixels (for example:- 2). This value specifies the space between characters in the element’s placeholder.No0
Style-InputFontClick this list to select the font of the element’s input value (text).NoOpen Sans
Style-InputSizeIn this box, enter the font size of the element’s input character in pixels.No14
Style-InputColorAllows you to define the color of the element”s input character. Click the left box to display the color canvas.
On the canvas:
1. On the horizontal bar, move the circle to select the color.
2. In the canvas, move the circle to select the tone of the color.
No#161616
Style-InputWeightIn this box, enter a value in the range from 1 to 9. This value specifies the thickness of the element’s input character.No4
Style-InputLetter SpacingIn this box, enter a numeric value in pixels (for example:- 2). This value specifies the space between characters in the element’s input character.No0
Style-PrefixColorAllows you to define the background color of the prefix box. Click the left box to display the color canvas.
On the canvas:
1. On the horizontal bar, move the circle to select the color.
2. In the canvas, move the circle to select the tone of the color.
No#FFFFFF
Style-Shape & DecorationTypeUnder the Shape and Decoration section, this property has the two following options:

Autofill:- If you select this option, the element will occupy the available space of the parent layout.

Manual:- If you select this option, you can define a specific size of the element.
NoAutofill
Style-Shape & DecorationWidthThis box becomes active after you click the Manual tab under Type. In this box, enter a numeric value (for example, 8) in pixels. This value specifies the width of the element.No
Style-Shape & DecorationXAllows you to move the element along the X-axis. When the value increases, the element moves towards the right edge of the canvas.No4
Style-Shape & DecorationYAllows you to move the element along the Y-axis. When the value increases, the element moves towards the bottom edge of the canvas.No4
Style-Shape & DecorationSelect ColorAllows you to define the element’s color when the user selects the element to perform the function on it.No#0F61FE
Style-Shape & DecorationBorder RadiusAllows you to define the radius of one of the corners of the element. Defining the radius of the corner makes the corner of the element round.No4
Style-Shape & DecorationBorder ColorAllows you to define element’s border’s color. Click the left box to display the color canvas.
On the canvas:
1. On the horizontal bar, move the circle to select the color.
2. In the canvas, move the circle to select the tone of the color.
No#C6C6C6
Style-TooltipShow TooltipClick this check box to make a tooltip available with the element.NoClear Check box
Style-TooltipShow Tooltip On Hover (Web)This property comes into view after you click to select the Show Tooltip check box. When selected, this property displays the tooltip after the user puts mouse pointer on the element.NoSelected Check boxWhen you select the Show Tooltip check box.
Style-TooltipMessageThis property allows you to define the tooptip’s text. You can configure the message by using the following options:
a. By using Static function
b. By mapping an attribute
c. By mapping an element

These three options are broadly described as below:

1. By Using the Static function
a. Click in the Message box to display the Search box.
b. In the Search box, enter Static to display the Static function.
c. Select the Static function.
d. In the Static function, click the Number parameter to display a context menu.
e On the menu, click to select String.
f. In the Static function, click the Value parameter and then enter the text (for example, Enter the mobile number)


2. By Mapping the Attribute
a. Click in the Message box to display the Search box.
b. In the Search box, enter the attribute’s name that stores the text.

c. After you find the attribute’s name,click to select it in the list.

Note:- To know more about defining the JSON structure that contains the attribute, click here.

3. By Mapping Element’s Value
Though this option is not used conventionally, you can map an element’s value to display it as a tooltip’s text. To map an element’s value:
a. Click in the Message box to display the Search box.
b. In the Search box, enter the element’s name that stores the text.
c. After you find the element’s name,click to select it in the list.
No{{ fx }}
Style-TooltipChoose IconAllows you to select an icon for the tooltip. To select the icon:
a. In Add box, click the Edit icon () to display the Material Icons dialog box.
b. In the Material Icons dialog box, click to select an icon and then click Select to select a material icon.
No
Style-TooltipIcon ColorAllow you to select the icon’s color. Click the left box to display the color canvas.
On the canvas:
1. On the horizontal bar, move the circle to select the color.
2. In the canvas, move the circle to select the tone of the color.

Data Configuration

TabProperty NameDescriptionMandatoryNew Default ValuesVisibility Rules
Data-InputEntity PathAllows you to map the entity or attribute when you want to fetch and display the data in the Prefix Input Field from the mapped entity or attribute. To map the entity or attribute:
a. Click in the Entity Path box to display a Search box.
b. In the Search box, enter the entity’s or attribute’s name to display it.
c. After you find the entity’s or attribute’s name, select it in the list.


Note:- To know about defining the JSON structure to fetch data from an entity, click here.
No{{ fx }}
Data-InputSubmission TypeClick this list to select one of the following values:
–> Next Focus:-
If you select this value, the application will highlight the next selectable element after the end-user enters the value in the input field.

–> Next Line:-
If you select this value, the application will move the mouse pointer to the next line after the user enters the value in the input field.
NoNext Focus
Data-InputKeyboard TypeClick this list and then select one of the following types of keyboard that the application will open. The user can use that keyboard type to enter the value in the element.

For instance: – If you select “Number“, the application will open a number-based keyboard that the user can use to enter the numeric value in the input field.
NoBecomes visible if the Read Only check box is clear.
Data-InputRead OnlyIf you click to select this check box, the user cannot edit the value in the element.NoClear Check box
Data-ValidationMaximum LengthIn this box, enter a numeric value (for example, 8) that specifies the maximum permissible number of characters that the user can enter in the prefix input field.No
Data-ValidationMessage On Max Length FailureIn this box, enter a message text that the application will display if the user attempts to enter more number of characters than the maximum permissible number of characters.No
Data-ValidationMinimum LengthIn this box, enter a numeric value (for example, 8) that specifies the minimum required number of characters that the user needs to enter in the element.No
Data-ValidationMessage On Minimum Length FailureIn this box, enter a message text that the application will display if the user enters fewer characters than the required minimum number of characters in the element.No
Data-ValidationReal Time<<To be discussed>>No

Security Configuration

TabProperty NameDescriptionMandatoryNew Default ValuesVisibility Rules
Security-BasicCopy & PasteThis property provides the following values:
–> Yes:- If you select this value, the user can copy and paste the value of the input element elsewhere.

–> No:- If you select this value, the user cannot copy and paste the value of the input element elsewhere.
NoSelected Check box
Security-BasicData MaskingThis property allows you to mask the data. After you click to select the Data Masking check box, the following boxes come into view:
1. Masking Type
2. N
3. Masking Symbol
NoClear Check box
Security-BasicMasking TypeClick this list to select one of the following options:
1. From Start
This option masks a specified number of characters (for example:- **ample123) from the left.

2. From End
This option masks a specified number of characters (for example:- Example1**) from the right.

3. From Start & End
This option masks specified numbers of characters (for example:- **ample***) from the left and right of the string.

4. Except Start
This option masks all characters except a specified number of characters (for example:- Ex********) from the left.

5. Except End
This option masks all characters except a specified number of characters (for example:- ********23) from the right.

6. Except Start & End
This option masks all characters except specified numbers of characters (for example:- Ex*****123) from the left and right.

7. All Alphabets
This option masks all alphabets (for example:- *******123) in the string.

8. All Numbers
This option masks all numbers (for example:- Example***) in the string.

9. All
This option masks all characters in the string.
NoFrom Start
Security-BasicNThis box comes into view after you click the Data Masking check box.

In this box, enter a numeric value that specifies the number of characters that are masked from right or left in the string.

For example:- If you select From Start in the Masking Type list and then enter 4 in the N box, the data masking property masks four characters from the left.

If you select From End in the Masking Type list and then enter 4 in the N box, the data masking property masks four characters from the right.
NoIf Data Masking check box is selected
Security-BasicMThis box comes into view after you select From Start & End in the Masking Type list.

In the M box, enter a numeric value that specifies the number of characters that the Data Masking feature masks from the right of the string.

For example:- If you enter 4 in the M box, the data masking property masks four characters from the right.
YesIf Masking Type = From Start & End
Security-BasicMasking SymbolClick this list and then select one of the following characters that you can use as a masking symbol or character:
1. *
2. &
3. %
4. $
5. #
6. @
7. x
8. –
9. +

Event Configuration

On the Prefix Input Field element, you can configure the following events:

  • onFocusOut
  • onCompletion
  • onTextChanged
  • onPrefixClick
  • onCharRemove

Configuring Regex

You can find this property as an option in the Input Type list. This property allows you to perform one of the following activities:

  • Select a pre-defined regex (regular expression) (for example:- PAN) to apply it to the input field
  • Select Custom Regex to define a new regex and then apply it to the input field.

To define a regex:

  1. In the Input Field panel, click the Input Type list and then select Regex, and the Regex Type box comes into view.
  2. In the Regex Type box, do one of the following activities:

Case1:- (If you want to configure a pre-defined regex)

  1. Click the Regex Type list and then select one of the following available regexes:
    • PAN
    • AADHAAR
    • Credit Card
    • Date
    • Time
    • Mobile Number

Case2:- (If you want to defined a new regex)

  1. Click the Regex Type list and then select Custom Regex, and the Enter Regex box comes into view.
  2. In the Enter Regex box, enter a regular expression (for example:- ^[A-Z]{2}-[0-9]{13}$ (a regular expression for the Indian Driving License format)).
  3. After you define a regular expression, click Apply to configure the input type for the input field element.

Configuring Formatter

In the Input Field element, you can use this feature to configure a user-defined format. After you define an input format, the input field allows and helps the user enter the value based on the user-defined format.

This feature will not allow the user to enter a value that violates the configured user-defined data format.

To configure a user-defined format:

  1. In the Input Field panel, click the Input Type list and then select Formatter, and the Formatter Expression box comes into view.
  2. In the Formatter Expression box, enter a format as follows:

Sample Format:

AAAA-0000-A

Let us understand this user-defined format as follows:

In the format string:

  • AAAA specifies that the data value will have the first four characters as alphabets.
  • (Hyphen) (a special character) specifies that the input field will automatically append a hyphen when the user enters a character after four alphabets. The input field will append the hyphen after four alphabets and before a new character.
  • 0000 specifies that the data value will have four digits (numeric values) after the hyphen.
  • – (a second hyphen) specifies that the input field will automatically append a hyphen when the user enters a character after four digits. The input field will append the hyphen after four digits and before a new character.
  • The last character, A, after the second hyphen, specifies that the Input Field will have the last character, an alphabet.

Let us see how the user enters the value in the Input Field that vDesigner’s user configured to accept the value that matches the user-defined format.

A JSON structure to fetch the text for Prefix Input Field’s tooltip

A JSON structure to fetch the values of Prefix Input Field

Was this article helpful?
YesNo