Input dialog window width

Hi there,

Could you tell me how can I modify the bpm input dialog windows width?
Maybe I need create a custom/jmix screen? I have about 20 parameters and when open the input dialog screen the width is not set perfectly.
Picture below:
Image Pasted at 2022-3-8 08-24

Hello @p.polyi ,

thank you for the report. Unfortunately, it is not adjustable right now, raised an issue for that.

As WA you can define your own Jmix Screen and set up required layout’s settings.

Regards,
Artem

Hi,

You can just Override the DynamicTaskProcessForm Screen, set the dialogMode width in the xml, that will take care of the dialog mode width.

You can also override the initForm method of the Screen to set the component widths based on field type or anything else:

@Override
protected void initForm(Form form, FormData formData) {
    boolean isDialog = OpenMode.DIALOG.equals(getWindow().getContext().getOpenMode());

    for (FormField formField : formData.getFields()) {
        String fieldCaption = !Strings.isNullOrEmpty(formField.getCaption()) ?
                formField.getCaption() :
                formField.getId();
        Component component = dynamicFormFieldComponentsFactory.createComponent(formField);
        setFormFieldWidth(formField.getType(), component, isDialog);
        if (component instanceof Component.HasCaption) {
            ((Component.HasCaption) component).setCaption(fieldCaption);
        }
        form.add(component);
    }
}

private void setFormFieldWidth(String type, Component component, boolean isDialog) {
    if (isDialog) {
        component.setWidth("100%");
        return;
    }

    switch (type) {
        case "date":
        case "dateTime":
        case "localdate":
        case "localdatetime":
        case "entity":
        case "entity-list":
        case "enum":
        case "platformEnum":
        case "file-description":
            component.setWidth(Component.AUTO_SIZE);
            break;
        default:
            component.setWidth("30%");
    }
}

Regards,
Gergő