Hi,
I have an issue with my Jmix application.
I have built a screen whose aim is to allow the logged in User to edit their personal data (username / first name / last name / e-mail / so on and so forth).
It has been designed as an editor screen, which fetches the data about the logged in user with the following code:
@Autowired
private CurrentAuthentication currentAuthentication;
@Autowired
private InstanceLoader<User> editorDl;
@Install(to = "editorDl", target = Target.DATA_LOADER)
protected User editorDlLoadDelegate(LoadContext<User> loadContext) {
return (User)currentAuthentication.getUser();
}
When I click the Save button, it tells me that the username field has been left empty, hence the saving process failed.
After debugging a bit, I discovered that Jmix, under the hood, when I click the Save and close button, performs the UPDATE query in a correct way, then it performs an INSERT INTO query in the same table, but committing an User entity whose all fields are null.
What could the problem be? How could I solve it?
Of course, don’t hesitate to ask if you need more clarifications.