IDEMPIERE-5952 - Adjust to return IDColumn recordID (#2130)
* IDEMPIERE-5952 - Adjust to return IDColumn recordID * IDEMPIERE-5952 - Adjusts
This commit is contained in:
parent
e33cadc2f9
commit
7865952db2
|
@ -1717,27 +1717,19 @@ 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;
|
||||
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());
|
||||
}
|
||||
|
||||
if (p_multipleSelection)
|
||||
{
|
||||
for (Object key : lsKeyValueOfSelectedRow){
|
||||
selectedDataList.add(key);
|
||||
}
|
||||
}
|
||||
|
||||
return selectedDataList;
|
||||
} // getSelectedRowKeys
|
||||
|
||||
|
|
Loading…
Reference in New Issue