Unit of measure

Hello,

When we generate screens, it shows the attribute as
“OpenQuote” field property=“number” “CloseQuote”
Now in case we have a attribute like Diameter and we want user to enter a value and then we want to indicate its in mm.
Diameter ______ (MM)
Let us say, we do not want to give the user and option like mm, cm, feet. We want user to convert to mm. So its a static label after the text field.
What is the best way to achieve this.

Thanks,
Prashanth

Hi Prashanth,

First of all, if you need additional UI components next to fields, you will not be able to use the FieldGroup component with automatically generated fields. You need to create custom or generated fields and use horizontal layout to place the field together with the static label. Another option is to use GridLayout instead of the whole FieldGroup, or Form if it’s the screen based on the new API.

To update the label when the field’s value changes, add an ItemPropertyChangeEvent listener to the datasource or data container where the edited entity is located. In the listener, calculate the value and set it to the label.

Regards,
Konstantin

Thank You Konstantin. I will try this.

Regards,
Prashanth