IDEMPIERE-2919 InfoBP don't take the first contact / IDEMPIERE-2230

This commit is contained in:
Carlos Ruiz 2015-10-30 09:14:05 -05:00
parent c60f5a7f88
commit 3a33c7aa60
1 changed files with 15 additions and 1 deletions

View File

@ -1272,7 +1272,21 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
recordSelectedData.put(keyCandidate, candidateRecord);// add or update selected record info
}else{
if (recordSelectedData.containsKey(keyCandidate)){// unselected record
recordSelectedData.remove(keyCandidate);
List<Object> recordSelected = recordSelectedData.get(keyCandidate);
IDColumn idcSel = null;
if (recordSelected.get(0) instanceof IDColumn) {
idcSel = (IDColumn) recordSelected.get(0);
}
IDColumn idcCan = null;
if (candidateRecord.get(0) instanceof IDColumn) {
idcCan = (IDColumn) candidateRecord.get(0);
}
if (idcSel != null && idcCan != null && idcSel.getRecord_ID().equals(idcCan.getRecord_ID())) {
recordSelected.set(0, candidateRecord.get(0)); // set same IDColumn for comparison
}
if (recordSelected.equals(candidateRecord)) {
recordSelectedData.remove(keyCandidate);
}
}
}