Lookup editor should search "Value" column too if IsValueDisplay is check
Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2979862
This commit is contained in:
parent
9685a343a4
commit
7e9652edc6
|
@ -684,7 +684,8 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
|
||||||
|
|
||||||
if (AD_Reference_ID != 0)
|
if (AD_Reference_ID != 0)
|
||||||
{
|
{
|
||||||
String query = "SELECT kc.ColumnName, dc.ColumnName, t.TableName "
|
boolean isValueDisplayed = false;
|
||||||
|
String query = "SELECT kc.ColumnName, dc.ColumnName, t.TableName, rt.IsValueDisplayed "
|
||||||
+ "FROM AD_Ref_Table rt"
|
+ "FROM AD_Ref_Table rt"
|
||||||
+ " INNER JOIN AD_Column kc ON (rt.AD_Key=kc.AD_Column_ID)"
|
+ " INNER JOIN AD_Column kc ON (rt.AD_Key=kc.AD_Column_ID)"
|
||||||
+ " INNER JOIN AD_Column dc ON (rt.AD_Display=dc.AD_Column_ID)"
|
+ " INNER JOIN AD_Column dc ON (rt.AD_Display=dc.AD_Column_ID)"
|
||||||
|
@ -693,48 +694,47 @@ public class WSearchEditor extends WEditor implements ContextMenuListener, Value
|
||||||
|
|
||||||
String displayColumnName = null;
|
String displayColumnName = null;
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
|
ResultSet rs = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
pstmt = DB.prepareStatement(query, null);
|
pstmt = DB.prepareStatement(query, null);
|
||||||
pstmt.setInt(1, AD_Reference_ID);
|
pstmt.setInt(1, AD_Reference_ID);
|
||||||
ResultSet rs = pstmt.executeQuery();
|
rs = pstmt.executeQuery();
|
||||||
|
|
||||||
if (rs.next())
|
if (rs.next())
|
||||||
{
|
{
|
||||||
m_keyColumnName = rs.getString(1);
|
m_keyColumnName = rs.getString(1);
|
||||||
displayColumnName = rs.getString(2);
|
displayColumnName = rs.getString(2);
|
||||||
m_tableName = rs.getString(3);
|
m_tableName = rs.getString(3);
|
||||||
|
String t = rs.getString(4);
|
||||||
|
isValueDisplayed = "Y".equalsIgnoreCase(t);
|
||||||
}
|
}
|
||||||
rs.close();
|
|
||||||
pstmt.close();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, query, e);
|
log.log(Level.SEVERE, query, e);
|
||||||
}
|
}
|
||||||
|
finally
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if (pstmt != null)
|
DB.close(rs, pstmt);
|
||||||
pstmt.close();
|
}
|
||||||
|
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (displayColumnName != null)
|
if (displayColumnName != null)
|
||||||
{
|
{
|
||||||
sql = new StringBuffer();
|
sql = new StringBuffer();
|
||||||
sql.append("SELECT ").append(m_keyColumnName)
|
sql.append("SELECT ").append(m_keyColumnName)
|
||||||
.append(" FROM ").append(m_tableName)
|
.append(" FROM ").append(m_tableName)
|
||||||
.append(" WHERE UPPER(").append(displayColumnName)
|
.append(" WHERE (UPPER(").append(displayColumnName)
|
||||||
.append(") LIKE ").append(DB.TO_STRING(text))
|
.append(") LIKE ").append(DB.TO_STRING(text));
|
||||||
.append(" AND IsActive='Y'");
|
if (isValueDisplayed)
|
||||||
|
{
|
||||||
|
sql.append(" OR UPPER(").append("Value")
|
||||||
|
.append(") LIKE ").append(DB.TO_STRING(text));
|
||||||
|
}
|
||||||
|
sql.append(")");
|
||||||
|
sql.append(" AND IsActive='Y'");
|
||||||
|
|
||||||
String wc = getWhereClause();
|
String wc = getWhereClause();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue