To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.
I need to get the updated item when "save" is clicked in a grid editor in Vaadin 8. The answer given in the above question is to write the value to a new bean using Binder#writeBean, however this isn't a satisfactory answer for me, as the bean in question is a persisted entity with an immutable ID (so a new bean won't match the old one). In fact I can't even construct a new instance of the bean in question (non-accessable constructor).
Surely there has to be a better way to get the edited value?
I'm currently getting the private field "edited" from EditorImpl as shown below, but this is obviously less than ideal.
Field editedField = event.getSource().getClass().getDeclaredField("edited");
editedField.setAccessible(true);MyBean myBean =(MyBean) editedField.get(event.getSource());