jmix-projects / jmix-ui

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

NullPointerException in EditAction.refreshState #748

Closed daring2 closed 2 years ago

daring2 commented 2 years ago

Steps to reproduce:

  1. Create a screen with table component
  2. Add edit action with visible="false" attribute for the table

Result: NullPointerException is thrown

Stacketrace:

Caused by: java.lang.NullPointerException: Cannot invoke "io.jmix.ui.component.ListComponent.getItems()" because "this.target" is null
    at io.jmix.ui.action.list.EditAction.refreshState(EditAction.java:276) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.action.BaseAction.setVisible(BaseAction.java:120) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.xml.layout.loader.AbstractComponentLoader.initAction(AbstractComponentLoader.java:629) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.xml.layout.loader.AbstractComponentLoader.loadDeclarativeActionByType(AbstractComponentLoader.java:597) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.xml.layout.loader.ActionsHolderLoader.loadDeclarativeAction(ActionsHolderLoader.java:29) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.xml.layout.loader.AbstractComponentLoader.loadActions(AbstractComponentLoader.java:543) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.xml.layout.loader.AbstractTableLoader.loadComponent(AbstractTableLoader.java:97) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.xml.layout.loader.ContainerLoader.loadSubComponents(ContainerLoader.java:36) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.xml.layout.loader.ContainerLoader.loadSubComponentsAndExpand(ContainerLoader.java:74) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.xml.layout.loader.WindowLoader.loadComponent(WindowLoader.java:85) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.sys.ScreensImpl.loadWindowFromXml(ScreensImpl.java:319) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.sys.ScreensImpl.createScreen(ScreensImpl.java:204) ~[jmix-ui-1.1.0.jar:na]
    at io.jmix.ui.sys.ScreensImpl.create(ScreensImpl.java:145) ~[jmix-ui-1.1.0.jar:na]
...
Afanasevaa36 commented 2 years ago

1.2.0-SNAPSHOT verified