diff --git a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java index 83bc5ecc40..3c868ea433 100644 --- a/org.adempiere.base/src/org/compiere/model/GridFieldVO.java +++ b/org.adempiere.base/src/org/compiere/model/GridFieldVO.java @@ -683,7 +683,7 @@ public class GridFieldVO implements Serializable public void loadLookupInfo() { try { - lookupInfo = MLookupFactory.getLookupInfo (ctx, WindowNo, TabNo,AD_Column_ID, displayType, + lookupInfo = MLookupFactory.getLookupInfo (ctx, WindowNo, TabNo, AD_Column_ID, displayType, Env.getLanguage(ctx), ColumnName, AD_Reference_Value_ID, IsParent, ValidationCode); if (lookupInfo == null) diff --git a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java index 7dd1438ade..0a705da80c 100644 --- a/org.adempiere.base/src/org/compiere/model/MLookupFactory.java +++ b/org.adempiere.base/src/org/compiere/model/MLookupFactory.java @@ -86,48 +86,7 @@ public class MLookupFactory public static MLookupInfo getLookupInfo(Properties ctx, int WindowNo, int Column_ID, int AD_Reference_ID) { - String ColumnName = ""; - int AD_Reference_Value_ID = 0; - boolean IsParent = false; - String ValidationCode = ""; - // - String sql = "SELECT c.ColumnName, c.AD_Reference_Value_ID, c.IsParent, vr.Code " - + "FROM AD_Column c" - + " LEFT OUTER JOIN AD_Val_Rule vr ON (c.AD_Val_Rule_ID=vr.AD_Val_Rule_ID) " - + "WHERE c.AD_Column_ID=?"; - PreparedStatement pstmt = null; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - pstmt.setInt(1, Column_ID); - // - rs = pstmt.executeQuery(); - if (rs.next()) - { - ColumnName = rs.getString(1); - AD_Reference_Value_ID = rs.getInt(2); - IsParent = "Y".equals(rs.getString(3)); - ValidationCode = rs.getString(4); - } - else - s_log.log(Level.SEVERE, "Column Not Found - AD_Column_ID=" + Column_ID); - } - catch (SQLException ex) - { - s_log.log(Level.SEVERE, "create", ex); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - // - MLookupInfo info = getLookupInfo (ctx, WindowNo, Column_ID, AD_Reference_ID, - Env.getLanguage(ctx), ColumnName, AD_Reference_Value_ID, IsParent, ValidationCode); - - return info; + return getLookupInfo(ctx, WindowNo, 0, Column_ID, AD_Reference_ID); } public static MLookupInfo getLookupInfo(Properties ctx, int WindowNo, int TabNo, int Column_ID, int AD_Reference_ID) @@ -189,7 +148,7 @@ public class MLookupFactory public static MLookup get (Properties ctx, int WindowNo, int TabNo, int Column_ID, int AD_Reference_ID) { // - MLookupInfo info = getLookupInfo (ctx, WindowNo, Column_ID, AD_Reference_ID); + MLookupInfo info = getLookupInfo (ctx, WindowNo, TabNo, Column_ID, AD_Reference_ID); return new MLookup(info, TabNo); } // get @@ -221,7 +180,7 @@ public class MLookupFactory Column_ID, AD_Reference_ID, language, ColumnName, AD_Reference_Value_ID, IsParent, ValidationCode); - } // createLookupInfo + } // getLookupInfo /************************************************************************** * Get Information for Lookups based on Column_ID for Table Columns or Process Parameters. @@ -348,7 +307,7 @@ public class MLookupFactory // s_log.finest("Query: " + info.Query); // s_log.finest("Direct: " + info.QueryDirect); return info; - } // createLookupInfo + } // getLookupInfo /************************************************************************** diff --git a/org.adempiere.base/src/org/compiere/util/Env.java b/org.adempiere.base/src/org/compiere/util/Env.java index c4fb04a588..7656bffacc 100644 --- a/org.adempiere.base/src/org/compiere/util/Env.java +++ b/org.adempiere.base/src/org/compiere/util/Env.java @@ -593,8 +593,7 @@ public final class Env */ public static String getContext (Properties ctx, int WindowNo, int TabNo, String context, boolean onlyTab) { - final boolean onlyWindow = onlyTab ? true : false; - return getContext(ctx, WindowNo, TabNo, context, onlyTab, onlyWindow); + return getContext(ctx, WindowNo, TabNo, context, onlyTab, onlyTab); } /**