Hi,
is there a way to discard changes in edit mode without closing view?
For example to achieve the same result of invoking close(StandardOutcome.DISCARD) but without leave view.
Thanks
Hi,
is there a way to discard changes in edit mode without closing view?
For example to achieve the same result of invoking close(StandardOutcome.DISCARD) but without leave view.
Thanks
Hi,
I guess you may try the following:
@Route(value = "offices/:id", layout = MainView.class)
@ViewController("Office.detail")
@ViewDescriptor("office-detail-view.xml")
@EditedEntityContainer("officeDc")
public class OfficeDetailView extends StandardDetailView<Office> {
private Office initialEntity;
@Autowired
private MetadataTools metadataTools;
@Subscribe
public void onBeforeShow(final BeforeShowEvent event) {
initialEntity = metadataTools.copy(getEditedEntity());
}
@Subscribe("resetBtn")
public void onResetBtnClick(final ClickEvent<JmixButton> event) {
metadataTools.copy(initialEntity, getEditedEntity());
}
}
Thanks Maxim, it could be a good solution, but i’m still giving the “You have unsaved changes” dialog after reset