From 9d02ecaadb7ef5ff48eef580718d5e87f04b3bdc Mon Sep 17 00:00:00 2001 From: hengsin Date: Sat, 5 Dec 2020 23:38:36 +0800 Subject: [PATCH] IDEMPIERE-4387 Cannot select C&W Business Partner in Multi Select Search (#438) - base on patch from Carlos and hints from hieplq --- org.adempiere.ui.zk/META-INF/MANIFEST.MF | 1 + .../WEB-INF/src/org/zkoss/addon/chosenbox/Chosenbox.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/META-INF/MANIFEST.MF b/org.adempiere.ui.zk/META-INF/MANIFEST.MF index 7f2d2660ec..a3afe89c84 100644 --- a/org.adempiere.ui.zk/META-INF/MANIFEST.MF +++ b/org.adempiere.ui.zk/META-INF/MANIFEST.MF @@ -29,6 +29,7 @@ Import-Package: groovy.transform.stc;version="2.4.7", org.apache.commons.fileupload.portlet;version="1.2.2", org.apache.commons.fileupload.servlet;version="1.2.2", org.apache.commons.fileupload.util;version="1.2.2", + org.apache.commons.lang3;version="3.1.0", org.apache.ecs, org.apache.ecs.xhtml, org.apache.tools.ant, diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/zkoss/addon/chosenbox/Chosenbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/zkoss/addon/chosenbox/Chosenbox.java index 7c06672c19..772a74e07f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/zkoss/addon/chosenbox/Chosenbox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/zkoss/addon/chosenbox/Chosenbox.java @@ -29,6 +29,7 @@ import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; +import org.apache.commons.lang3.StringEscapeUtils; import org.zkoss.lang.Objects; import org.zkoss.xel.VariableResolver; import org.zkoss.zk.au.out.AuSetAttribute; @@ -723,7 +724,8 @@ public class Chosenbox extends HtmlBasedComponent { addEventListener("onSearching", _eventListener); } - private Integer getIndexFromValue(String value, boolean checkSubList) { + private Integer getIndexFromValue(String valueHTML, boolean checkSubList) { + String value = StringEscapeUtils.unescapeHtml4(valueHTML); for (int i = 0; i < _model.getSize(); i++) { if (value.equals(_model.getElementAt(i).toString())) return Integer.valueOf(i);