IDEMPIERE-1015 Menu lookup add 'action' after name of the node / IDEMPIERE-943

This commit is contained in:
Richard Morales 2013-06-25 19:04:51 -05:00
parent b91f9e76bf
commit 5fbbee3826
2 changed files with 13 additions and 4 deletions

View File

@ -18,6 +18,7 @@
package org.adempiere.webui.component; package org.adempiere.webui.component;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import org.zkoss.zk.ui.event.InputEvent; 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 */ /** comboItems All menu labels */
private String[] comboItems; private String[] comboItems;
@ -48,6 +49,8 @@ public class AutoComplete extends Combobox
private String[] contents; private String[] contents;
private HashMap<Comboitem, String> mapItems = new HashMap<Comboitem, String>();
/** /**
* Set menu labels * Set menu labels
* *
@ -134,6 +137,7 @@ public class AutoComplete extends Combobox
{ {
if (comboItems == null || val == null) { if (comboItems == null || val == null) {
super.getChildren().clear(); super.getChildren().clear();
mapItems.clear();
return; return;
} }
@ -171,7 +175,7 @@ public class AutoComplete extends Combobox
} }
if (contents != null && i < contents.length && contents[i] != null && contents[i].trim().length() > 0) 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(); it.remove();
} }
} }
public String getContent(Comboitem item)
{
return mapItems.get(item);
}
} }

View File

@ -341,7 +341,7 @@ public class TreeSearchPanel extends Panel implements EventListener<Event>, Tree
Comboitem item = (Comboitem) comp; Comboitem item = (Comboitem) comp;
if (item.getLabel().equals(value)) if (item.getLabel().equals(value))
{ {
String type = item.getContent(); String type = cmbSearch.getContent(item);
if (!Util.isEmpty(type)) if (!Util.isEmpty(type))
selectTreeitem(value+"."+type); selectTreeitem(value+"."+type);
else else
@ -370,7 +370,7 @@ public class TreeSearchPanel extends Panel implements EventListener<Event>, Tree
{ {
Comboitem item = (Comboitem) comp; Comboitem item = (Comboitem) comp;
String value = item.getLabel(); String value = item.getLabel();
String type = item.getContent(); String type = cmbSearch.getContent(item);
if (!Util.isEmpty(type)) if (!Util.isEmpty(type))
selectTreeitem(value+"."+type); selectTreeitem(value+"."+type);
else else