I have a Table with datasource with vehicles. I want to remove the vehicles which has the same date and time. I have sett up an example like this.
for (Vehicle vehicle : vehiclesDs.getItems()) {
for(Assignment assignment1 : vehicle.getAssignment()){
if(assignment1.getAssignmentClosed() == false) {
Date startDate = assignmentStartDateField.getValue();
Date endDate = assignmentEndDateField.getValue();
if (assignment1.getAssignmentStartDate().compareTo(startDate) == 0) {
if (assignment1.getAssignmentEndDate().compareTo(endDate) == 0) {
vehiclesDs.excludeItem(vehicle);
}
}
}
}
}
vehiclesDs.refresh();
vehiclesTable.repaint();
When I repaint the table the same data is shown. Non is removed in table but is removed in the datasource.