Hi,
I’m quite new to jmix and currently struggeling with following:
I have basic User entity and OtherEntity. OtherEntity has a reference to User with entityPicker in UI. After selecting the User I use onUserFieldComponentValueChange-Event to check, whether the selected user is active. If not, I want to clear the field in UI.
I’ve tried to clear it with following options:
userField.clear()
userField.setValue(null)
getEditedEntity().setUserID(null)
In detailView the entityPickerField changes to the selected user. And the field is never cleared in detailView. But I need it to be cleared in detailView, so that the users of the program can see it is empty. Back in ListView it shows, that an inactive user will not be saved. Is this a possible bug, or am I missing something?
I have added the classes of a small sample project for your reference.
entitypicker.zip (23.2 KB)
entityPicker_xml.zip (5.3 KB)
I’m using Jmix 2.3.1
Edit: if I would use entityComboBox and set itemsContainer the same code works as expected.
Many thanks,
Stefanie