When implementing a custom validation for a grid editor, it would be nice to be able to access the bean that is currently edited. My validation of a field depends on the value of another field of the bean. However, I currently cannot see a way to access the currently edited bean. Using the grid’s current selection does not work reliably, unfortunately, since the user can double-click a row without selecting it first.
Have you tried Grid.getEditor().getBinder().getBean()?
Thank you for your reply. Yes, I did indeed try this, but it returns always null. My guess is that I would have to set the editor to immediate in order for the binder to keep the bean(setBean vs. readBean). Unfortunately I cannot do this. The EditorImpl also stores the Bean, but does not give any public or protected way to access it.
The bean is actually stored in the Editor even in the buffered case, we should provide the API on the Editor level to get the bean in both cases. There’s a related
ticket
in GitHub that you might want to follow