Convert TextField to CheckBox (or any other type)


I am still new to Cuba. I have created a new entity with its standard screens.
At a later stage, I want to convert a field (created as textfield by default) to a checkbox. However, I am not able to do that from Studio. I can only select the fieldgroup, and cannot really modify the settings of a field.
I tried deleting the textfield, and adding a new checkbox from the palette, but for some reason, I cannot insert it in the field group. So the layout looks messy.

What is in general the best approach to modify the types of existing fields?


Shady Hanna

Hi Shady,

FieldGroup chooses a component for displaying your attribute automatically based on the attribute type and some parameters, see the table at the bottom of this section. So CheckBox is used only for boolean attributes.

However, you can add a custom field to you FieldGroup and handle it as you wish. See custom XML attribute and the addCustomField() method example in the same section.

Hi Konstantin,

Thanks for the help. Actually, I did modify the attribute type to Checkbox, but for some reason, it did not work through “hot deploy”.
I had to restart the application server for it to display correctly.

Thanks again.