IDEMPIERE-5104 MLookup: Inconsistent use of TabNo (#1057)

This commit is contained in:
hengsin 2021-12-18 02:24:21 +08:00 committed by GitHub
parent cafe018404
commit 160db45e84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -71,6 +71,7 @@ public final class MLookup extends Lookup implements Serializable
{ {
super(info.DisplayType, info.WindowNo); super(info.DisplayType, info.WindowNo);
m_info = info; m_info = info;
m_tabNo = TabNo;
if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn); if (log.isLoggable(Level.FINE)) log.fine(m_info.KeyColumn);
// load into local lookup, if already cached // load into local lookup, if already cached
@ -105,6 +106,8 @@ public final class MLookup extends Lookup implements Serializable
/** The Lookup Info Value Object */ /** The Lookup Info Value Object */
private MLookupInfo m_info = null; private MLookupInfo m_info = null;
private int m_tabNo = 0;
/** Storage of data Key-NamePair */ /** Storage of data Key-NamePair */
private volatile LinkedHashMap<Object,Object> m_lookup = new LinkedHashMap<Object,Object>(); private volatile LinkedHashMap<Object,Object> m_lookup = new LinkedHashMap<Object,Object>();
/** The Data Loader */ /** The Data Loader */
@ -888,7 +891,7 @@ public final class MLookup extends Lookup implements Serializable
{ {
if (info.IsValidated) return true; if (info.IsValidated) return true;
if (info.ValidationCode.length() == 0) return true; if (info.ValidationCode.length() == 0) return true;
String validation = Env.parseContext(m_info.ctx, m_info.WindowNo, m_info.ValidationCode, false); String validation = Env.parseContext(m_info.ctx, m_info.WindowNo, m_tabNo, m_info.ValidationCode, false);
if (validation.equals(info.parsedValidationCode)) return true; if (validation.equals(info.parsedValidationCode)) return true;
return false; return false;
} }
@ -1007,7 +1010,7 @@ public final class MLookup extends Lookup implements Serializable
// not validated // not validated
if (!m_info.IsValidated) if (!m_info.IsValidated)
{ {
String validation = Env.parseContext(m_info.ctx, m_info.WindowNo, m_info.tabNo, m_info.ValidationCode, false); String validation = Env.parseContext(m_info.ctx, m_info.WindowNo, m_tabNo, m_info.ValidationCode, false);
m_info.parsedValidationCode = validation; m_info.parsedValidationCode = validation;
if (validation.length() == 0 && m_info.ValidationCode.length() > 0) if (validation.length() == 0 && m_info.ValidationCode.length() > 0)
{ {

View File

@ -1545,7 +1545,7 @@ public final class Env
* @param WindowNo Number of Window * @param WindowNo Number of Window
* @param tabNo Number of Tab * @param tabNo Number of Tab
* @param value Message to be parsed * @param value Message to be parsed
* @param onlyTab if true, no defaults are used * @param onlyTab if true, only value from tabNo are used
* @param ignoreUnparsable if true, unsuccessful @return parsed String or "" if not successful and ignoreUnparsable * @param ignoreUnparsable if true, unsuccessful @return parsed String or "" if not successful and ignoreUnparsable
* @return parsed context * @return parsed context
*/ */
@ -1629,15 +1629,15 @@ public final class Env
* *
* @param ctx context * @param ctx context
* @param WindowNo Number of Window * @param WindowNo Number of Window
* @param TabNo Number of Tab * @param tabNo Number of Tab
* @param value Message to be parsed * @param value Message to be parsed
* @param onlyWindow if true, no defaults are used * @param onlyTab if true, no value from tabNo are used
* @return parsed String or "" if not successful * @return parsed String or "" if not successful
*/ */
public static String parseContext (Properties ctx, int WindowNo, int tabNo, String value, public static String parseContext (Properties ctx, int WindowNo, int tabNo, String value,
boolean onlyWindow) boolean onlyTab)
{ {
return parseContext(ctx, WindowNo, tabNo, value, onlyWindow, false); return parseContext(ctx, WindowNo, tabNo, value, onlyTab, false);
} // parseContext } // parseContext
/** /**