From f82777c527c02315d23200e5603a05aba9019801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Tak=C3=A1cs?= <93127072+PeterTakacs300@users.noreply.github.com> Date: Wed, 3 May 2023 08:31:40 +0200 Subject: [PATCH] IDEMPIERE-5702 - IndexOutOfBoundsException on Info Window (#1812) * IDEMPIERE-5702 - IndexOutOfBoundsException on Info Window * IDEMPIERE-5702 - pr1812 patch by Heng Sin --- .../src/org/adempiere/webui/info/InfoWindow.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index b929ad2fa6..5f04fbcd0b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -2965,8 +2965,6 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL cacheOriginalValues(rowIndex); - int gridFieldsOffset = 1; // First column is the id, and its not on the infoColumns - @SuppressWarnings("unchecked") List row = (List)oRow; List originalSelectedRow = temporarySelectedData.get(keyViewValue); @@ -2974,15 +2972,14 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL // While restoring values we dong want to trigger listeners model.removeTableModelListener(this); - - for(int i=0; i < infoColumns.length; i++) + + for(int i=0; i < columnInfos.length; i++) { - if(infoColumns[i].isReadOnly() == false) // Only replace editable column, in case some other data changed on db + if(columnInfos[i].isReadOnly() == false) // Only replace editable column, in case some other data changed on db { - int colIndex = i + gridFieldsOffset; - Object obj = originalSelectedRow.get(colIndex); - model.setValueAt( obj, rowIndex, colIndex); - } + Object obj = originalSelectedRow.get(i); + model.setValueAt( obj, rowIndex, i); + } } // Restore isSelected status on IDColumn