IDEMPIERE-5588 - Multiselect Chosenbox Editor Doesn't Initialise its List when Tab First Opened (#1744)

* IDEMPIERE-5588 - Multiselect Chosenbox Editor Doesn't Initialise its List when Tab First Opened

* IDEMPIERE-5588 - pr1744 patch
This commit is contained in:
Peter Takács 2023-03-22 09:52:28 +01:00 committed by GitHub
parent 51ceaacb43
commit bf7c9792af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 21 deletions

View File

@ -597,15 +597,21 @@ public class MLookupFactory
retValue.DisplayColumn = lookupDisplayColumn; retValue.DisplayColumn = lookupDisplayColumn;
retValue.InfoWindowId = infoWindowId; retValue.InfoWindowId = infoWindowId;
retValue.QueryDirect = MRole.getDefault().addAccessSQL(directQuery, TableName, true, false); retValue.QueryDirect = MRole.getDefault().addAccessSQL(directQuery, TableName, true, false);
List<String> lookupDisplayColumns = new ArrayList<String>(); List<String> lookupDisplayColumns = new ArrayList<String>();
if (isValueDisplayed) if (isValueDisplayed)
lookupDisplayColumns.add("Value"); lookupDisplayColumns.add("Value");
lookupDisplayColumns.add(lookupDisplayColumn != null ? lookupDisplayColumn : DisplayColumn); lookupDisplayColumns.add(lookupDisplayColumn != null ? lookupDisplayColumn : DisplayColumn);
s_cacheRefTable.put(key.toString(), retValue.cloneIt()); retValue.lookupDisplayColumns = lookupDisplayColumns;
retValue.lookupDisplayColumns = lookupDisplayColumns; if(list != null) {
return retValue; retValue.lookupDisplayColumnNames = new ArrayList<>();
} // getLookup_Table for (LookupDisplayColumn ldc : list) {
retValue.lookupDisplayColumnNames.add(ldc.ColumnName);
}
}
s_cacheRefTable.put(key.toString(), retValue.cloneIt());
return retValue;
} // getLookup_Table
/** /**
* Get Embedded Lookup SQL for Table Lookup * Get Embedded Lookup SQL for Table Lookup
* @param language report language * @param language report language

View File

@ -17,12 +17,12 @@
package org.compiere.model; package org.compiere.model;
import java.io.Serializable; import java.io.Serializable;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;
import org.compiere.util.DB; import org.compiere.util.DB;
@ -209,11 +209,13 @@ public class MLookupInfo implements Serializable, Cloneable
public String DisplayColumn; public String DisplayColumn;
public int InfoWindowId; public int InfoWindowId;
public List<String> lookupDisplayColumns = null; public List<String> lookupDisplayColumns = null;
/** public List<String> lookupDisplayColumnNames = null;
* String representation
/**
* String representation
* @return info * @return info
*/ */
public String toString() public String toString()

View File

@ -98,7 +98,7 @@ public class InfoListSubModel implements ListSubModel<ValueNamePair> {
.append(nRows); .append(nRows);
if (lookup instanceof MLookup) { if (lookup instanceof MLookup) {
MLookup mlookup = (MLookup) lookup; MLookup mlookup = (MLookup) lookup;
List<String> displayColumns = mlookup.getLookupInfo().lookupDisplayColumns; List<String> displayColumns = mlookup.getLookupInfo().lookupDisplayColumnNames;
if (displayColumns != null && displayColumns.size() > 0) { if (displayColumns != null && displayColumns.size() > 0) {
queryBuilder.append(",") queryBuilder.append(",")
.append("searchcolumn:") .append("searchcolumn:")