Skip to content

Commit

Permalink
IDEMPIERE-5952 - Adjust to return IDColumn recordID (idempiere#2130)
Browse files Browse the repository at this point in the history
* IDEMPIERE-5952 - Adjust to return IDColumn recordID

* IDEMPIERE-5952 - Adjusts
  • Loading branch information
VitorHenri authored Jan 18, 2024
1 parent 9143aa0 commit f23e751
Showing 1 changed file with 12 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1717,28 +1717,20 @@ protected Integer getIntSelectedRowKey(int tableId)
} // 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

/**
Expand Down

0 comments on commit f23e751

Please sign in to comment.