I have the following class
public class ControlHardware {
..................
public BeanItemContainer<Scannerr> getListaScannerOficina() {
List<Scanner> lista = null;
try {
lista = this.getControladorInventario().getServicioScanner()
.listaScannerOficina(this.getControladorDominio().getOficinaSeleccionada(), 0, 20);
} catch (ExcepcionDao e) {
e.printStackTrace();
}
BeanItemContainer<Scanner> cu;
if (lista != null && !lista.isEmpty()) {
cu = new BeanItemContainer<Scanner>(lista);
} else {
cu = new BeanItemContainer<Scanner>(Scanner.class);
}
return cu;
}
}
to change the source table
table.setContainerDataSource( ControlHardware.getListaScannerOficina());
and Form
public class Formularioextends Form implements ClickListener {
............
setWriteThrough(false);
......
}
@Override
public void buttonClick(ClickEvent event) {
Button source = event.getButton();
if (source == save) {
super.commit();
}
}
@Override
public void setItemDataSource(Item newDataSource) {
newContactMode = false;
if (newDataSource != null) {
List<Object> orderedProperties = Arrays
.asList(this.NATURAL_COL_ORDER_DISPOSITIVO);
super.setItemDataSource(newDataSource, orderedProperties);
setReadOnly(true);
} else {
super.setItemDataSource(null);
getFooter().setVisible(false);
}
}
}
When you update an item (bean), the changes are not reflected in table,but
only if I add a new item changes are reflected
example:
Table
code name
125 juan
126 pedro
I choose the first item
From____________________
code 125
name juan
add edit salve
click on edit
From
code 128
name juan
click on salve
table
code name
125 juan
126 pedro
change table not reflected,but click in add
From
code 130
name nameNew
click on save
Table_____________________
code name
128 juan :blink:
126 pedro
130 nameNew
The first item was updated at the time of entering a new item, any suggestions???:blink:(=