jmix icon indicating copy to clipboard operation
jmix copied to clipboard

EntityValueAccessException thrown while opening screen with manually added dynamic attribute

Open Flaurite opened this issue 3 years ago • 0 comments

Description

Jmix: 1.3.2

Demo project contains configured Category for User entity and includes one attribute: +cats-cat-name.

User edit/browse contains <loader dynamicAttributes="true"/>

Demo project: trdynattr.zip

Steps to reproduce

Case 1.

  1. Download demo project above.
  2. Open user browse screen.

AR

io.jmix.core.EntityValueAccessException: Dynamic attributes should be loaded explicitly
	at io.jmix.dynattr.DynamicAttributesState.getAttributeValue(DynamicAttributesState.java:59)
	at io.jmix.core.entity.BaseEntityEntry.getAttributeValue(BaseEntityEntry.java:81)
	at io.jmix.core.entity.EntityValues.getValue(EntityValues.java:100)
	at io.jmix.core.entity.EntityValues.getValueEx(EntityValues.java:131)
	at io.jmix.ui.component.data.table.ContainerTableItems.getItemValue(ContainerTableItems.java:116)
	at io.jmix.ui.component.table.TableItemWrapper.getPropertyValue(TableItemWrapper.java:81)
	at io.jmix.ui.component.table.TableItemPropertyWrapper.getValue(TableItemPropertyWrapper.java:37)
	at io.jmix.ui.component.impl.AbstractTable.formatCellValue(AbstractTable.java:1243)
	at io.jmix.ui.widget.JmixTable.formatPropertyValue(JmixTable.java:345)
	at io.jmix.ui.widget.JmixTable.getPropertyValue(JmixTable.java:260)
	at com.vaadin.v7.ui.Table.parseItemIdToCells(Table.java:2396)
	at com.vaadin.v7.ui.Table.getVisibleCellsNoCache(Table.java:2240)
	at com.vaadin.v7.ui.Table.refreshRenderedCells(Table.java:1783)
	at io.jmix.ui.widget.JmixGroupTable.refreshRenderedCells(JmixGroupTable.java:736)
	at com.vaadin.v7.ui.Table.attach(Table.java:4338)

Case 2

  1. Download the same project above
  2. In user browse delete column with dynamic attribute: <column id="+cats-cat-name"/>
  3. Try to save some value in dynamic attribute field.
  4. Edit this entity instance again.

AR Field with Dynamic Attribute is empty.

Note All these cases are not reproduced if you configure Dynamic Attribute Visibility for User edit/browse screens.

Flaurite avatar Aug 23 '22 06:08 Flaurite