diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AutoComplete.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AutoComplete.java index 0446cb4d21..f45aa3f09a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AutoComplete.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/AutoComplete.java @@ -18,6 +18,7 @@ package org.adempiere.webui.component; import java.util.Arrays; +import java.util.HashMap; import java.util.Iterator; import org.zkoss.zk.ui.event.InputEvent; @@ -36,7 +37,7 @@ public class AutoComplete extends Combobox /** * */ - private static final long serialVersionUID = -6440285742490532737L; + private static final long serialVersionUID = 8350448733668388572L; /** comboItems All menu labels */ private String[] comboItems; @@ -48,6 +49,8 @@ public class AutoComplete extends Combobox private String[] contents; + private HashMap mapItems = new HashMap(); + /** * Set menu labels * @@ -134,6 +137,7 @@ public class AutoComplete extends Combobox { if (comboItems == null || val == null) { super.getChildren().clear(); + mapItems.clear(); return; } @@ -171,7 +175,7 @@ public class AutoComplete extends Combobox } if (contents != null && i < contents.length && contents[i] != null && contents[i].trim().length() > 0) { - comboitem.setContent(contents[i]); + mapItems.put(comboitem, contents[i]); } } } @@ -180,4 +184,9 @@ public class AutoComplete extends Combobox it.remove(); } } + + public String getContent(Comboitem item) + { + return mapItems.get(item); + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/TreeSearchPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/TreeSearchPanel.java index 09e247ca58..d2e6574e34 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/TreeSearchPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/TreeSearchPanel.java @@ -341,7 +341,7 @@ public class TreeSearchPanel extends Panel implements EventListener, Tree Comboitem item = (Comboitem) comp; if (item.getLabel().equals(value)) { - String type = item.getContent(); + String type = cmbSearch.getContent(item); if (!Util.isEmpty(type)) selectTreeitem(value+"."+type); else @@ -370,7 +370,7 @@ public class TreeSearchPanel extends Panel implements EventListener, Tree { Comboitem item = (Comboitem) comp; String value = item.getLabel(); - String type = item.getContent(); + String type = cmbSearch.getContent(item); if (!Util.isEmpty(type)) selectTreeitem(value+"."+type); else