IDEMPIERE-5720 Multi select product on orders is broken (#1835)

This commit is contained in:
Carlos Ruiz 2023-05-20 16:41:20 +02:00 committed by GitHub
parent e945e7e3c8
commit 2e38742ec9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 7 deletions

View File

@ -104,8 +104,26 @@ public class GridTabDataBinder implements ValueChangeListener {
if (newValue instanceof Integer[])
{
newValues = ((Integer[])newValue);
}
else if (newValue instanceof Object[])
{
newValues = new Integer[((Object[])newValue).length];
for (int idx=0; idx<((Object[])newValue).length; idx++)
{
if (((Object[])newValue)[idx] instanceof Integer)
{
newValues[idx] = (Integer) ((Object[])newValue)[idx];
}
else
{
logger.severe("Multiple values can only be processed for IDs (Integer)");
throw new IllegalArgumentException("Multiple Selection values not available for this field. " + e.getPropertyName());
}
}
}
if (newValue instanceof Integer[] || newValue instanceof Object[])
{
newValue = newValues[0];
if (newValues.length > 1)
{
Integer valuesCopy[] = new Integer[newValues.length - 1];
@ -117,12 +135,7 @@ public class GridTabDataBinder implements ValueChangeListener {
newValues = null;
}
}
else if (newValue instanceof Object[])
{
logger.severe("Multiple values can only be processed for IDs (Integer)");
throw new IllegalArgumentException("Multiple Selection values not available for this field. " + e.getPropertyName());
}
if (e.isInitEdit())
mTable.setValueAt (newValue, row, col, false, true);
else