//Port Name Column
WidgetColumn<EthPortConfig, MaterialTextBox> portName = new WidgetColumn<EthPortConfig, MaterialTextBox>() {
@Override
public MaterialTextBox getValue(EthPortConfig object) {
MaterialTextBox statusT = new MaterialTextBox();
//statusT.setText(object.portName);
statusT.setText("POE");
ethPortConfigs.get(0).portName="POE";
statusT.setWidth("80%");
return statusT;
}
};
portName.setFieldUpdater(new FieldUpdater<EthPortConfig, MaterialTextBox>() {
@Override
public void update(int i, EthPortConfig portConfig, MaterialTextBox widgets) {
MaterialToast.fireToast("inside updater");
}
});
ethInterfaceTable.addColumn(portName,"Port Name");
I expected the update method in the Updater to be called when writing into the TextBox but it is not happening, can anyone point in the right direction? What should I check?
Also the MaterialListBox is not firing any update event.
I didn't find any example in the gwt-material-demo and I cannot find a solution.
I have also some row press handlers, is it possible that they are blocking the field updater?
// Configure the tables long press duration configuration.
// The short press is when a click is held less than this duration.
ethInterfaceTable.setLongPressDuration(400);
// Add a row long press handler, called when a row is long pressed.
ethInterfaceTable.addRowLongPressHandler((e, mouseEvent, model, row) -> {
//GWT.log("Row Long Pressed: " + model.getId() + ", x:" + mouseEvent.getPageX() + ", y: " + mouseEvent.getPageY());
MaterialToast.fireToast("Row long pressed");
return true;
});
// Add a row short press handler, called when a row is short pressed.
ethInterfaceTable.addRowShortPressHandler((e, mouseEvent, model, row) -> {
//.log("Row Short Pressed: " + model.getId() + ", x:" + mouseEvent.getPageX() + ", y: " + mouseEvent.getPageY());
EthPortConfig p = (EthPortConfig) model;
MaterialToast.fireToast("Row short pressed");
/*Cell.Context c = new Cell.Context($(row).index(),ethInterfaceTable.getColumnOffset(),model);
portName.getCell().setValue(c,$(row).asElement(),portName.getValue(p));*/
MaterialToast.fireToast("Content: "+portName.getValue(p).getText());
return true;
});