From e1d6104ce8182c5e1bfcb1546cf200170c90681c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 3 Jan 2009 03:15:12 +0000 Subject: [PATCH] Fix [2482989] Find Form: boolean is not working ok https://sourceforge.net/tracker2/index.php?func=detail&aid=2482989&group_id=176962&atid=955896 --- .../adempiere/webui/window/FindWindow.java | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java b/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java index 1e4ddd10a5..e14c690ed9 100644 --- a/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java +++ b/zkwebui/WEB-INF/src/org/adempiere/webui/window/FindWindow.java @@ -57,6 +57,8 @@ import org.adempiere.webui.event.ValueChangeEvent; import org.adempiere.webui.event.ValueChangeListener; import org.adempiere.webui.part.MultiTabPart; import org.compiere.model.GridField; +import org.compiere.model.GridFieldVO; +import org.compiere.model.MLookupFactory; import org.compiere.model.MProduct; import org.compiere.model.MQuery; import org.compiere.model.MRole; @@ -145,6 +147,8 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe public static final int TABNO = 99; /** Length of Fields on first tab */ public static final int FIELDLENGTH = 20; + /** Reference ID for Yes/No */ + public static final int AD_REFERENCE_ID_YESNO = 319; private int m_AD_Tab_ID = 0; private MUserQuery[] userQueries; @@ -442,6 +446,27 @@ public class FindWindow extends Window implements EventListener,ValueChangeListe GridField mField = m_findFields[i]; String columnName = mField.getColumnName(); + // Make Yes-No searchable as list + if (mField.getVO().displayType == DisplayType.YesNo) + { + GridFieldVO vo = mField.getVO(); + GridFieldVO ynvo = vo.clone(vo.ctx, vo.WindowNo, vo.TabNo, vo.AD_Window_ID, vo.AD_Tab_ID, vo.tabReadOnly); + ynvo.IsDisplayed = true; + ynvo.displayType = DisplayType.List; + ynvo.AD_Reference_Value_ID = AD_REFERENCE_ID_YESNO; + + ynvo.lookupInfo = MLookupFactory.getLookupInfo (ynvo.ctx, ynvo.WindowNo, ynvo.AD_Column_ID, ynvo.displayType, + Env.getLanguage(ynvo.ctx), ynvo.ColumnName, ynvo.AD_Reference_Value_ID, + ynvo.IsParent, ynvo.ValidationCode); + ynvo.lookupInfo.InfoFactoryClass = ynvo.InfoFactoryClass; + + GridField ynfield = new GridField(ynvo); + + // replace the original field by the YN List field + m_findFields[i] = ynfield; + mField = ynfield; + } + if (columnName.equals("Value")) hasValue = true; else if (columnName.equals("Name"))