Hi,
Inside the onBeforeShow
listenner of an edit screen, if I modify the editedEntity
, the changes are made on the parent browser screen. This is very confusing. In over a year working with Jmix I never noticed that and there is no information about that in the documentation. I think that editedEntity should represent the instance we are editing in the screen OR be null before it’s initialization.
step to reproduce:
- add a onBeforeShow in any editor screen (let’s use UserEdit)
@Subscribe
private fun onBeforeShow(event: BeforeShowEvent) {
editedEntity.firstName = "foo"
}
- run the app → open a browser → edit an entity (the changes done in
onBeforeShow
are not visible) - go back to the browser screen by clicking the cancel button (the changes are visible)
best regards