IDEMPIERE-973 problem with searching in System Element
This commit is contained in:
parent
2a9162fec2
commit
4b3295e563
|
@ -336,6 +336,27 @@ public class MTable extends X_AD_Table
|
|||
return retValue;
|
||||
} // getKeyColumns
|
||||
|
||||
/**
|
||||
* Get Identifier Columns of Table
|
||||
* @return Identifier columns
|
||||
*/
|
||||
public String[] getIdentifierColumns()
|
||||
{
|
||||
getColumns(false);
|
||||
ArrayList<String> list = new ArrayList<String>();
|
||||
//
|
||||
for (int i = 0; i < m_columns.length; i++)
|
||||
{
|
||||
MColumn column = m_columns[i];
|
||||
if (column.isIdentifier())
|
||||
list.add(column.getColumnName());
|
||||
}
|
||||
String[] retValue = new String[list.size()];
|
||||
retValue = list.toArray(retValue);
|
||||
return retValue;
|
||||
} // getIdentifierColumns
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* Get PO Class Instance
|
||||
* @param Record_ID record
|
||||
|
|
|
@ -37,6 +37,7 @@ import org.adempiere.webui.window.FDialog;
|
|||
import org.compiere.minigrid.ColumnInfo;
|
||||
import org.compiere.minigrid.IDColumn;
|
||||
import org.compiere.model.I_C_ElementValue;
|
||||
import org.compiere.model.MTable;
|
||||
import org.compiere.util.DB;
|
||||
import org.compiere.util.DisplayType;
|
||||
import org.compiere.util.Env;
|
||||
|
@ -119,6 +120,9 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener<Event>
|
|||
//
|
||||
|
||||
if (queryValue != null && queryValue.length() > 0)
|
||||
{
|
||||
MTable table = MTable.get(Env.getCtx(), p_tableName);
|
||||
if (table.getIdentifierColumns().length > 1)
|
||||
{
|
||||
String separator = I_C_ElementValue.Table_Name.equalsIgnoreCase(p_tableName) ? "-" : "_";
|
||||
if (txt2.isVisible())
|
||||
|
@ -131,6 +135,8 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener<Event>
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
executeQuery();
|
||||
renderItems();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue