I would like to update a in the line being edited in the Grid Editor as soon as another value is altered. So for example if I change the currency in a purchase I want the amount to be adjusted for that currency. With that in mind I have:
Grid grid = new Grid();
grid.getEditor().setEnabled(true);
grid.addColumn(Purchase::getAmount())
.setEditorBinding(amountField, Purchase::setAmount);
grid.addColumn(Purchase::getCurrency())
.setEditorBinding(currencyField, Purchase::setCurrency);
grid.getEditor().getBinder().addValueChangeListener(event ->
{
Component component = event.getComponent();
if(component.equals(currencyField))
{
Purchase purchase = binder.getBean();
purchase.setAmount(amountAdjustedForCurrency(purchase.getCurrency()));
// How do I update to the amount in the grid for that row?
}
});
My question is how do I update the amount in the Grid? Even though the bean has been adjusted the screen isn’t updated…