FormLayout for CustomField colSpan not working

In the constructor of my FormLayout-extended form, I do:

        setResponsiveSteps(
                // Use one column by default
                new ResponsiveStep("0", 1),
                // Use two columns, if layout's width exceeds 500px
                new ResponsiveStep("500px", 2));
        addFormItem(arrangement, getTranslation("arrangement"));
        setColspan(arrangement, 2);
        addFormItem(identifier1, getTranslation("identifier1"));
        addFormItem(identifier2, getTranslation("identifier2"));

where arrangement is a CustomField<MyDto> and identifier1, identifier2 are TextField.

However, the arrangement field appears in the same column as identifier1.

Am I doing anything wrong?

As you are using addFormItem you must set the colspan on the FormItem not the component

FormLayout.FormItem formItem = addFormItem(arrangement, getTranslation("arrangement"));
form.setColspan(formitem, 2);

:man_facepalming:

thanks

it obviously works well. thanks a lot :smile: