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