GroupTable does not take into account layout

Hi

EDIT : If I generate the screen asking for a simple table, same issue. If I put myself a Table no issue. Strange.
EDIT 2 : I think there is a hidden computation somewhere based on the screen size before the window is shrinked to dialog, probably around the layout.

I’ve created a basic generic entity browser, which uses a GroupTable to display list of entities, and forced it to 800x600 dialog.

Then there is no way to make the GroupTable content stretched in the allocated space, I tried defining column width to e.g 100px, defining a fixed width of 400px for the GroupTable, but I still have the result you can see below, with scrollbars.

If I replace manually the GroupTable by a simple Table, the layout works as intended.

I put the xml just in case, but this is the generic entity browser screen as it is generated by Studio.


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
        caption="msg://browseCaption"
        class="com.busy.app.web.accountingplan.AccountingPlanBrowse"
        focusComponent="accountingPlansTable"
        lookupComponent="accountingPlansTable"
        messagesPack="com.busy.app.web.accountingplan">
    <dsContext>
        <groupDatasource id="accountingPlansDs"
                         class="com.busy.app.entity.AccountingPlan"
                         view="_local">
            <query>
                <![CDATA[select e from busy$AccountingPlan e]]>
            </query>
        </groupDatasource>
    </dsContext>
    <dialogMode forceDialog="true"
                height="600"
                width="800"/>
    <layout expand="accountingPlansTable"
            spacing="true">
        <filter id="filter"
                applyTo="accountingPlansTable"
                datasource="accountingPlansDs">
            <properties include=".*"/>
        </filter>
        <groupTable id="accountingPlansTable"
                    width="100%">
            <actions>
                <action id="create"/>
                <action id="edit"/>
                <action id="remove"/>
            </actions>
            <columns>
                <column id="account"/>
                <column id="subAccount"/>
                <column id="label"/>
            </columns>
            <rows datasource="accountingPlansDs"/>
            <rowsCount/>
            <buttonsPanel id="buttonsPanel"
                          alwaysVisible="true">
                <button id="createBtn"
                        action="accountingPlansTable.create"/>
                <button id="editBtn"
                        action="accountingPlansTable.edit"/>
                <button id="removeBtn"
                        action="accountingPlansTable.remove"/>
            </buttonsPanel>
        </groupTable>
    </layout>
</window>

group_table_refuses_layout

Hi,

GroupTable component saves its settings before the screen containing the table closes. In this case, when you open the same screen, settings such as columns order and size will be restored. I suppose that this is the source of your problem. When you changed the column width to 400px in the screen descriptor, this had no effect, because the saved settings were restored.

I can suggest you two options:

  • Add settingsEnabled=“false” to your table configuration - this will prevent settings applying for the table.
  • Remove sec$UserSetting records with settings for this screen, e.g. from Administration -> Entity Inspector screen (Do not forget to close screen with the table first).

Regards,

Gleb

Great. Gone with disabling the settings aiming for consistency across users. Thanks a lot Gleb.
Mike