After migrating a production project from Jmix 1.4.4
to 1.5.5
a browse screen containing columns being collapsed by default (descriptor) is unusable.
I found out, that column collapse behavior changed being moved to a post init task.
if (StringUtils.isNotEmpty(collapsed)) {
//There is a check in Vaadin Table component if the column to collapse is related to
//container property or is generated one (exception will be thrown if neither one nor other condition met).
//If the column being created is generated one then it will not be related to some container property
//and will be added to Table component as generated only after full table initialization (including
//injection of generator methods in a view marked with @Install).
//So we defer setting of collapsed property until the initialization is completed.
getComponentContext().addPostInitTask((context, window) ->
column.setCollapsed(Boolean.parseBoolean(collapsed)));
}
If the user does not have the permission to view a column/property to be collapsed, screen loading fails completely. This is a major issue for migrating any application to Jmix 1.5.5
.
Caused by: java.lang.IllegalArgumentException: Property 'createdDate' was not found in the container
at com.vaadin.v7.ui.Table.setColumnCollapsed(Table.java:1381) ~[vaadin-compatibility-server-8.14.3-4-jmix.jar!/:8.14.3-4-jmix]
at io.jmix.ui.component.impl.AbstractTable$ColumnImpl.setCollapsed(AbstractTable.java:2016) ~[jmix-ui-1.5.5.jar!/:na]
at io.jmix.ui.xml.layout.loader.AbstractTableLoader.lambda$loadColumn$0(AbstractTableLoader.java:457) ~[jmix-ui-1.5.5.jar!/:na]
at io.jmix.ui.xml.layout.loader.ComponentLoaderContext.executePostInitTasks(ComponentLoaderContext.java:141) ~[jmix-ui-1.5.5.jar!/:na]
at io.jmix.ui.sys.ScreensImpl.createScreen(ScreensImpl.java:228) ~[jmix-ui-1.5.5.jar!/:na]
at io.jmix.ui.sys.ScreensImpl.create(ScreensImpl.java:145) ~[jmix-ui-1.5.5.jar!/:na]
at io.jmix.ui.menu.MenuItemCommands$ScreenCommand.createScreen(MenuItemCommands.java:230) ~[jmix-ui-1.5.5.jar!/:na]
at io.jmix.ui.menu.MenuItemCommands$ScreenCommand.run(MenuItemCommands.java:169) ~[jmix-ui-1.5.5.jar!/:na]
at io.jmix.ui.menu.SideMenuBuilder$MenuCommandExecutor.accept(SideMenuBuilder.java:272) ~[jmix-ui-1.5.5.jar!/:na]
at io.jmix.ui.menu.SideMenuBuilder$MenuCommandExecutor.accept(SideMenuBuilder.java:257) ~[jmix-ui-1.5.5.jar!/:na]
at io.jmix.ui.component.mainwindow.impl.SideMenuImpl$MenuItemImpl.menuSelected(SideMenuImpl.java:587) ~[jmix-ui-1.5.5.jar!/:na]
at io.jmix.ui.widget.JmixSideMenu$1.menuItemTriggered(JmixSideMenu.java:91) ~[jmix-ui-1.5.5.jar!/:na]
... 103 common frames omitted