jmix-projects / jmix-ui

DEPRECATED. Use https://github.com/jmix-framework/jmix
https://www.jmix.io
3 stars 7 forks source link

Incorrect index calculation for adding action in WebAbstractActionsHolderComponent #758

Closed Flaurite closed 2 years ago

Flaurite commented 2 years ago

Description

See https://github.com/cuba-platform/cuba/issues/3201

Steps to reproduce

  1. Download attached project: demo.zip

  2. Open Sandbox -> Entities -> Order entity -> Order GroupTable

AR

java.lang.IndexOutOfBoundsException: Index: 7, Size: 6
    at java.util.LinkedList.checkPositionIndex(LinkedList.java:560)
    at java.util.LinkedList.add(LinkedList.java:507)
    at com.vaadin.ui.AbstractOrderedLayout.addComponent(AbstractOrderedLayout.java:146)
    at io.jmix.ui.component.impl.AbstractActionsHolderComponent.addAction(AbstractActionsHolderComponent.java:218)
    at io.jmix.ui.component.impl.AbstractActionsHolderComponent.addAction(AbstractActionsHolderComponent.java:189)
    at com.company.master.screen.sandbox.entities.order.grouptable.OrderGroupTableBrowse.onInit(OrderGroupTableBrowse.java:69)
    at io.jmix.core.common.event.EventHub.publish(EventHub.java:170)
    at io.jmix.ui.screen.Screen.fireEvent(Screen.java:124)
    at io.jmix.ui.screen.UiControllerUtils.fireEvent(UiControllerUtils.java:58)
    at io.jmix.ui.sys.ScreensImpl.fireScreenInitEvent(ScreensImpl.java:1352)
    at io.jmix.ui.sys.ScreensImpl.createScreen(ScreensImpl.java:223)
    at io.jmix.ui.sys.ScreensImpl.create(ScreensImpl.java:145)
    at io.jmix.ui.menu.MenuItemCommands$ScreenCommand.createScreen(MenuItemCommands.java:306)
    at io.jmix.ui.menu.MenuItemCommands$ScreenCommand.run(MenuItemCommands.java:242)
    at io.jmix.ui.menu.SideMenuBuilder$MenuCommandExecutor.accept(SideMenuBuilder.java:272)
    at io.jmix.ui.menu.SideMenuBuilder$MenuCommandExecutor.accept(SideMenuBuilder.java:257)
    at io.jmix.ui.component.mainwindow.impl.SideMenuImpl$MenuItemImpl.menuSelected(SideMenuImpl.java:587)
reznikova21 commented 2 years ago

1.2.0-SNAPSHOT - verified