How to insert blank place into FieldGroup?

Hi,
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.

Hi,

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.

Regards,
Gleb

Hi,
I don’t want to separate them in columns, but in one column with blank spaces (or some separators) between separated fields:

field1
field2

field3
field4
field5

field6

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.

Regards,
Gleb

Cuba Studio doesn’t allow to insert such field into FieldGroup. It modifies the text

<field id="separator">  
	<label height="10px"/>  
</field>  

into

<field id="separator"/>  

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.

Regards,
Gleb

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
What’s wrong?

Add assign a custom component to a FieldGroup’s field you need to use the setComponent method, see the documentation.

Hi,
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);

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/STUDIO-4025