Fix parsing issues with auto complete
This commit is contained in:
parent
cd5295437b
commit
edf64328d9
|
@ -128,7 +128,10 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData> {
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
this.multiAutoComplete = (Boolean) ((Map<Boolean, Object>) data).get("multiAutoComplete");
|
this.multiAutoComplete = (Boolean) ((Map<Boolean, Object>) data).get("multiAutoComplete");
|
||||||
|
|
||||||
List<Map<String, Object>> dataList = (List<Map<String, Object>>) ((Map<String, Object>) data).get("autoCompleteSingleDataList");
|
List<Map<String, Object>> dataList = (List<Map<String, Object>>) ((Map<String, Object>) data).get("autocompleteSingle");
|
||||||
|
if (dataList == null) {
|
||||||
|
dataList = (List<Map<String, Object>>) ((Map<String, Object>) data).get("autoCompleteSingleDataList");
|
||||||
|
}
|
||||||
|
|
||||||
this.autoCompleteSingleDataList = new ArrayList<>();
|
this.autoCompleteSingleDataList = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -174,14 +177,15 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData> {
|
||||||
List<Map<String, Object>> autoCompletes = new ArrayList<>();
|
List<Map<String, Object>> autoCompletes = new ArrayList<>();
|
||||||
NodeList autoCompleteSingles = item.getChildNodes();
|
NodeList autoCompleteSingles = item.getChildNodes();
|
||||||
for (int i = 0; i < autoCompleteSingles.getLength(); i++) {
|
for (int i = 0; i < autoCompleteSingles.getLength(); i++) {
|
||||||
if (autoCompleteSingles.item(i) instanceof Element && !((Element) autoCompleteSingles.item(i)).getTagName().equals("option")) {
|
if (autoCompleteSingles.item(i) instanceof Element) {
|
||||||
|
if (!((Element) autoCompleteSingles.item(i)).getTagName().equals("option")) {
|
||||||
Element node = (Element) autoCompleteSingles.item(i);
|
Element node = (Element) autoCompleteSingles.item(i);
|
||||||
if (!node.hasChildNodes()) {
|
if (!node.hasChildNodes()) {
|
||||||
node.appendChild(node);
|
node.appendChild(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
autoCompletes.add(singleToMap(node));
|
autoCompletes.add(singleToMap(node));
|
||||||
} else if (((Element) autoCompleteSingles.item(i)).getTagName().equals("option")) {
|
} else {
|
||||||
Element node = item.getOwnerDocument().createElement("autocompleteSingle");
|
Element node = item.getOwnerDocument().createElement("autocompleteSingle");
|
||||||
node.appendChild(autoCompleteSingles.item(i));
|
node.appendChild(autoCompleteSingles.item(i));
|
||||||
node.setAttribute("url", item.getAttribute("url"));
|
node.setAttribute("url", item.getAttribute("url"));
|
||||||
|
@ -189,6 +193,7 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData> {
|
||||||
autoCompletes.add(singleToMap(node));
|
autoCompletes.add(singleToMap(node));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
dataMap.put("autocompleteSingle", autoCompletes);
|
dataMap.put("autocompleteSingle", autoCompletes);
|
||||||
//dataMap.put("optionsRoot", item != null ? item.getAttribute("optionsRoot") : "");
|
//dataMap.put("optionsRoot", item != null ? item.getAttribute("optionsRoot") : "");
|
||||||
//Element optionElement = (Element) item.getElementsByTagName("option").item(0);
|
//Element optionElement = (Element) item.getElementsByTagName("option").item(0);
|
||||||
|
|
Loading…
Reference in New Issue