How can I insert blank place into FieldGroup to separate logically associated field groups?
Now I have to use several FieldGroups and this has side effect in non-aligned captions and inputs.
Currently, you can use columns within the FieldGroup component to separate fields or just to spend space more efficiently. You can read more about it the documentation.
Could you please describe in more details, if you need a different approach.
I don’t want to separate them in columns, but in one column with blank spaces (or some separators) between separated fields:
In this case, you can add a field with an empty label and define the desired height, for instance:
... <field property="name"/> <field id="separator"> <label height="10px"/> </field> <field property="email"/> ...
Alternatively, you can specify a style for a label, that it will be presented as a horizontal line or whatever you prefer.
Cuba Studio doesn’t allow to insert such field into FieldGroup. It modifies the text
<field id="separator"> <label height="10px"/> </field>
and I get an error opening the entity edit form:
GuiDevelopmentException: Property ‘separator’ is not found in entity ‘app$Object’
Thank you for reporting the issue, I’ve created a YouTrak issue, see the link on the right.
For now, you need to add such field definition manually. Sorry for the inconvenience.
I try to add the separator field manually in init() or postInit() methods:
WebFieldGroup.FieldConfig fc = mainFieldGroup1.createField("separator"); mainFieldGroup1.addField(fc,0,1); ComponentsFactory cf = AppBeans.get(ComponentsFactory.NAME); Label label = cf.createComponent(Label.class); label.setWidth("10px"); label.setParent(fc.getComponent());
but there is no new fields in the mainFieldGroup1 at all
Add assign a custom component to a FieldGroup’s field you need to use the setComponent method, see the documentation.
Thank you, this code works normal:
WebFieldGroup.FieldConfig fc = fieldGroup.createField("separator"); fieldGroup.addField(fc, 0, 1); Label label = componentsFactory.createComponent(Label.class); label.setWidth("10px"); fc.setComponent(label);
See the following issue in our bug tracker: