IDEMPIERE-5952 - Adjust to return IDColumn recordID (#2130)

* IDEMPIERE-5952 - Adjust to return IDColumn recordID

* IDEMPIERE-5952 - Adjusts
This commit is contained in:
Vitor Henrique Dos Santos 2024-01-18 03:23:53 -03:00 committed by Carlos Ruiz
parent e33cadc2f9
commit 7865952db2
1 changed files with 12 additions and 20 deletions

View File

@ -1717,28 +1717,20 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
} // getIntSelectedRowKey } // getIntSelectedRowKey
/** /**
* Get the keys of selected row/s based on layout defined in prepareTable * Get the keys of selected rows
* @deprecated * @return selected IDs or UUIDs
* @return IDs if selection present
* author ashley
*/ */
protected ArrayList<Object> getSelectedRowKeys() @SuppressWarnings("unchecked")
protected <T extends Serializable> List<T> getSelectedRowKeys()
{ {
ArrayList<Object> selectedDataList = new ArrayList<Object>(); List<T> selectedDataList = new ArrayList<>();
Collection<Object> lsKeyValueOfSelectedRow = getSelectedRowInfo().keySet(); for (Map.Entry<Object, List<Object>> rowInfo : getSelectedRowInfo().entrySet()) {
if (lsKeyValueOfSelectedRow.size() == 0) if(rowInfo.getValue().get(0) instanceof IDColumn idColumn)
{ selectedDataList.add((T)idColumn.getRecord_ID());
return selectedDataList; else if(rowInfo.getValue().get(0) instanceof UUIDColumn uuidColumn)
} selectedDataList.add((T)uuidColumn.getRecord_UU());
}
if (p_multipleSelection) return selectedDataList;
{
for (Object key : lsKeyValueOfSelectedRow){
selectedDataList.add(key);
}
}
return selectedDataList;
} // getSelectedRowKeys } // getSelectedRowKeys
/** /**