Hola a todos.
Necesito eliminar de una tabla ciertas filas que cumplan con una conidicion. Necesito hacer esto ya que no puedo filtrar cuando creo el dataSource.
Quiero poder eliminar de la tabla (o del container) todas aquellas filas que cumplan un estado. Paso el codigo que tengo, pero me genera un error. En table.removeItem(item);
Desde ya muchisimas gracias.
public void eliminarEstados (){
Iterator<?> i = table.getContainerDataSource().getItemIds().iterator();
Item item;
while (i.hasNext()) {
Object key = i.next();
item= table.getContainerDataSource().getItem(key);
Object value = item.getItemProperty("status").getValue();
if (value.equals(1)){
table.removeItem(item);
//table.getContainerDataSource().removeItem(item);
}
}
}
Este es el log del error:
[2017-11-09 20:48:33.679]
[1543636 ]
[http-nio-8090-exec-6]
(ERROR) com.inodes.hrdata.ui.sections.MenuLine - Provided id of the wrong type for class com.inodes.hrdata.entities.CaptureDevice. Expected: class java.lang.String, got class com.vaadin.data.hbnutil.HbnContainer$EntityItem
org.hibernate.TypeMismatchException: Provided id of the wrong type for class com.inodes.hrdata.entities.CaptureDevice. Expected: class java.lang.String, got class com.vaadin.data.hbnutil.HbnContainer$EntityItem
at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:135)