Resident Portal UI Specifications
Overview
UI specs of resident module are used to configure the form fields across Resident Portal. UI specs are saved as a JSON file with a list of fields. Each field has a set of attributes/ properties that can be configured which affects the look and feel along with the functionality of the field.
Below is the list of all the properties available for each field in the Resident Portal UI specs:
Property Name | Details | Sample Value |
| The id property is the unique id provided to a field to uniquely identify it. The id can be alpha-numeric without any spaces between them. | "id":"zone" |
| This is a non-mandatory property used to describe the field. | "description": "zone" |
| This property defines label name for the field. This property has sub-attributes as the language code (eng, fra, ara) to store data in different languages based on the country's configuration. | "labelName": { <br>"eng": "Zone", <br>"ara": "منطقة", <br>"fra": "Zone"} |
| This property defines the kind of UI component to be used to capture data in UI. Currently the values that can be used are: <br/> • textbox (creates multiple textboxes for each field to capture input in all the languages configured for the setup)<br/>• dropdown <br/>• fileupload <br/> • date (creates a date picker)<br/> • ageDate (creates a date picker along with number toggle to provide age directly)<br/> • checkbox (creates a toggle checkbox for the field which can be checked or unchecked)<br/> • button (creates dropdown options as buttons, which user can select easily) |
|
| This property decides if the field is to be displayed in the UI form or not. It is useful for some internal fields which do not need any input from the user. |
|
| This is a mandatory property which decides if the field is a required form field or not. If true, user must provide some value for the field. |
|
| This property defines the data type of the value corresponding to this field. The data types supported are “number”, “string” and “simpleType”.<br/> The type “simpleType” means that language specific value will be saved along with the language code. |
|
| This property is relevant when control type is “dropdown” or “button”. It defines if the field is of type “default” or “dynamic”. <br/>If it is “dynamic” then all the options for the dropdown are populated from the “master.dynamic_field” table otherwise they are populated from corresponding table example “master.gender” |
|
| This is relevant for 2 cases:<br/>1. When control type is “dropdown”/ “button” and the type is “dynamic” then “subtype” can be used to populate the options for the field with the data available in “master.dynamic_field” table.<br/>2. When the control type is “fileupload”, then the property ”subtype” is used to map the field to a “code” in the “master.doc_category” table. |
|
|
| <br>"validators": [{ <br>"langCode": "eng", <br>"type": "regex", <br>"validator": "^(?=.{0,50}$).*", <br>"arguments": [], <br>"errorMessageCode": "UI_1000"<br>},{ <br>"langCode": "ara", <br>"type": "regex", <br>"validator": "^[A-Z]+$", <br>"arguments": []<br>},{ <br>"langCode": "fra", <br>"type": "regex",<br>"validator": "^[A-Z]+$", <br>"arguments": []<br>}] |
| This attribute is mandatory for the location dropdown fields. <br/>The value will be as per corresponding location hierarchy level from the master.loc_hierarchy_list table. | {<br>"id":"region",<br>"controlType":"dropdown",<br>"fieldType":"default",<br>"type":"simpleType",<br>"parentLocCode":"MOR",<br>"locationHierarchyLevel":1<br>..} |
| This attribute is to be used only for location dropdown fields and it is optional. <br/>The corresponding location dropdown will be pre populated in UI based on the value in “parentLocCode”. <br/>If this attribute is NOT mentioned in UI specs, then the dropdown will be populated based on selection in its parent dropdown, as before. <br/>For the first dropdown, in case this attribute is not mentioned in UI specs then the value from “mosip.country.code” configuration will be used for backward compatibility. | {<br>"id":"region",<br>"controlType":"dropdown",<br>"fieldType":"default",<br>"type":"simpleType",<br>"parentLocCode":"MOR",<br>"locationHierarchyLevel":1<br>..} |
| * This property is used to group the fields on the screen. <br>* If it is skipped, then all the fields will appear in same sequence (horizontally layout) as they appear in UI specs. <br>* If you want the first and fifth field to be in same row in the screen, you can add this attribute with same group name. <br>* The UI is responsive so it will accommodate as many fields in one row as they will fit comfortably. |
|
| This is used to optionally apply some CSS styles to the UI field container. | "containerStyle": {<br>"width": "600px",<br>"margin-right": "10px"<br>} |
Last updated