Skip to content

Controls

With the 'Controls' section you will be able to register all information needed to build form fields across the application. The 'Controls' items can be used to generate form fields for many purposes as made at filter and edit-form.

Fields

A control contains the following fields to be defined:

Property

The name of entity property to be linked in the rendered form field.

Requirements Rules:

  • Is Required;
  • The name must exist in the Properties list for the uistructure entity

Example:

1
2
Controls:
- Property: My_Property_1


Label

The label that should be displayed with the rendered form field.

Requirements Rules:

  • Is Required;
  • Max length of 100 chars

Example:

1
2
3
Controls:
- Property: My_Property_1
  Label: 'My label field'


Hint

The hint that should be displayed with the rendered form field. The hint info is displayed right below of the input form field element, the main purpose is to provide a tip for filling the field improving the user experience.

Example:

1
2
3
4
Controls:
- Property: My_Property_1
  Label: 'My label field'
  Hint: Inform the value for property 1


Placeholder

The placeholder which will be rendered as a sample value inside the input field, which can also be used to give extra instructions about how to fill the field properly.

Example:

1
2
3
4
5
Controls:
- Property: My_Property_1
  Label: 'My label field'
  Hint: Inform the value for property 1
  Placeholder: Inform a value from 1 to 10


Type

The type of input element that should be used to render the form field. Some extra control model properties are required accordingly to selected type as shown below.

Possible types are:

  • text: Creates a simple text field;
  • number: Creates a input field with html type set for 'number';
  • date: Creates a input field attached to a date-picker;
  • switch: Creates a switch button;
  • radio: Creates a set of radio options allowing the user to select one;
  • check: Creates a checkbox input field;
  • combo: Creates a dropdown select field with options allowing the user to select one;
  • multiline: Creates a textarea input field;
  • currency: Creates a input field that allows only digits and uses a currency mask;
  • decimal: Creates a input field that allows only digits;

Note:

The type of input element should be compatible with the property type that is being rendered. For example, if you use a 'switch' type for a 'DateTime' property it will render a switch button for that property and you'll not be able to send requests because the data format will be invalid for that property at backend.

Requirements Rules:

  • Is Required;
  • Must be an Allowed valid type, according to the types informed above

Example:

1
2
3
4
5
6
7
Controls:
- Property: My_Property_1
  Label: 'Property 1'
  Type: text
- Property: My_Property_2
  Label: 'Property 2'
  Type: currency


Source

The source of options to be rendered for some control types. The value of 'source' model property must be the name of the 'uiservice' which will be used to obtain the options to render. The source can be understood as a list of objects, in this case these objects are retrieved from backend using the linked 'uiservice' and rendered as options for the control property.

Requirements Rules:

  • Is Required for control types: radio & combo;
  • The name must exist in UIServices list in the current model;

Example:

1
2
3
4
5
Controls:
- Property: My_Property_1
  Label: 'My label field'
  Type: combo
  Source: ChildOptionsService


ValueField

The property name that should be read from source objects and used as selected value for the control property.

Requirements Rules:

  • Is Required for control types: radio & combo;
  • Must be a valid property name for the entity used at linked source;

Example:

1
2
3
4
5
6
Controls:
- Property: My_Property_1
  Label: 'My label field'
  Type: combo
  Source: ChildOptionsService
  ValueField: Id # The rendered options will use the value of this property as a 'value' for form field option.


LabelFields

The list of property names used to render the options in form field. The label fields compose the presentational piece of the field option.

Requirements Rules:

  • Is Required for control types: radio & combo;
  • Must be a valid property name for the entity used at linked source;

Example:

1
2
3
4
5
6
7
Controls:
- Property: My_Property_1
  Label: 'My label field'
  Type: combo
  Source: ChildOptionsService
  ValueField: Id
  LabelFields: ['Name'] # The rendered options will use the value of this property as a 'label' for form field option.


LabelCharacterSeparator

The string that should be used to separate the control LabelFields, used for scenarios which the labelFields contains more than one field. Defaults to '-' if not informed.

Requirements Rules:

  • Max length of 3 chars

Example:

1
2
3
4
5
6
7
8
Controls:
- Property: My_Property_1
  Label: 'My label field'
  Type: combo
  Source: ChildOptionsService
  ValueField: Id
  LabelFields: ['Name', 'Code']
  LabelCharacterSeparator: '-' # The label for form field options will be rendered as: 'Name-Code' in this sample.


Back to top