Layout problem

I am facing a layout problem my editor not displaying properly.

It looks fine in the Cuba Studio, but when I run the app, it is shrunk.

This started happening when I added a tab sheet to the screen.

What I expected that it would grow to the contents.
All my widgets are sized to AUTO


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
        caption="msg://editorCaption"
        class="com.skriptogama.brillianterp.web.dimension.DimensionEdit"
        datasource="dimensionDs"
        focusComponent="generalFieldGroup"
        messagesPack="com.skriptogama.brillianterp.web.dimension">
    <dsContext>
        <datasource id="dimensionDs"
                    class="com.skriptogama.brillianterp.entity.Dimension"
                    view="_local"/>
    </dsContext>
    <dialogMode closeable="true"
                forceDialog="true"
                height="AUTO"
                modal="true"
                resizable="true"
                width="AUTO"/>
    <layout expand="mainTabSheet"
            margin="true"
            spacing="true">
        <tabSheet id="mainTabSheet">
            <tab id="generalTab"
                 caption="msg://GeneralTab"
                 margin="true,false,false,false"
                 spacing="true">
                <fieldGroup id="generalFieldGroup"
                            datasource="dimensionDs">
                    <column width="300px">
                        <field property="code"/>
                        <field property="name"/>
                        <field property="global"/>
                        <field property="disabled"/>
                    </column>
                </fieldGroup>
            </tab>
            <tab id="commentTab"
                 caption="msg://CommentTab"
                 margin="true,false,false,false"
                 spacing="true">
                <fieldGroup id="commentFieldGroup"
                            datasource="dimensionDs">
                    <column width="300px">
                        <field property="comment"/>
                    </column>
                </fieldGroup>
            </tab>
        </tabSheet>
        <frame id="windowActions"
               align="BOTTOM_LEFT"
               screen="editWindowActions"/>
    </layout>
</window>

When I set my screen’s height to some fixed value, then it is displayed. But it was working with auto x auto size when I had no Tab Sheet in it. Following is an example of the dialog with screen set to auto size.


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
        caption="msg://editorCaption"
        class="com.skriptogama.brillianterp.web.dimension.DimensionValueEdit"
        datasource="dimensionValueDs"
        focusComponent="fieldGroup"
        messagesPack="com.skriptogama.brillianterp.web.dimension">
    <dsContext>
        <datasource id="dimensionValueDs"
                    class="com.skriptogama.brillianterp.entity.DimensionValue"
                    view="dimensionvalue-with-parent"/>
    </dsContext>
    <dialogMode closeable="true"
                forceDialog="true"
                height="AUTO"
                modal="true"
                width="AUTO"/>
    <layout expand="windowActions"
            spacing="true">
        <fieldGroup id="fieldGroup"
                    datasource="dimensionValueDs">
            <column width="300px">
                <field property="parent"/>
                <field property="code"/>
                <field property="name"/>
                <field property="global"/>
                <field property="disabled"/>
                <field property="comment"
                       rows="5"/>
            </column>
        </fieldGroup>
        <frame id="windowActions"
               screen="editWindowActions"/>
    </layout>
</window>

What might be a problem here?

Thank you.

da6ae5ac560b0554b9f4c3de9937c700

8ee98fb3d3c7667dcf1cd072a9969064

ace530a3c00c393e893ce306a9230ae3

Hello, Darius.

The problem you faced with is that TabSheet has 100% height relative to the parent by default. TabSheet’s parent has no fixed size, that’s why your layout is shrunk.

To fix it you should set AUTO height to the TabSheet component.

More about layout rules you can find here

1 Like

Thanks, Daniil.

I see the difference between these two examples. In the first I set mainTabSheet as the expand, and in the other - WindowActions.