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) {
|
||||
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<>();
|
||||
|
||||
|
@ -174,19 +177,21 @@ public class AutoCompleteData extends ComboBoxData<AutoCompleteData> {
|
|||
List<Map<String, Object>> autoCompletes = new ArrayList<>();
|
||||
NodeList autoCompleteSingles = item.getChildNodes();
|
||||
for (int i = 0; i < autoCompleteSingles.getLength(); i++) {
|
||||
if (autoCompleteSingles.item(i) instanceof Element && !((Element) autoCompleteSingles.item(i)).getTagName().equals("option")) {
|
||||
Element node = (Element) autoCompleteSingles.item(i);
|
||||
if (!node.hasChildNodes()) {
|
||||
node.appendChild(node);
|
||||
}
|
||||
if (autoCompleteSingles.item(i) instanceof Element) {
|
||||
if (!((Element) autoCompleteSingles.item(i)).getTagName().equals("option")) {
|
||||
Element node = (Element) autoCompleteSingles.item(i);
|
||||
if (!node.hasChildNodes()) {
|
||||
node.appendChild(node);
|
||||
}
|
||||
|
||||
autoCompletes.add(singleToMap(node));
|
||||
} else if (((Element) autoCompleteSingles.item(i)).getTagName().equals("option")) {
|
||||
Element node = item.getOwnerDocument().createElement("autocompleteSingle");
|
||||
node.appendChild(autoCompleteSingles.item(i));
|
||||
node.setAttribute("url", item.getAttribute("url"));
|
||||
node.setAttribute("optionsRoot", item.getAttribute("optionsRoot"));
|
||||
autoCompletes.add(singleToMap(node));
|
||||
autoCompletes.add(singleToMap(node));
|
||||
} else {
|
||||
Element node = item.getOwnerDocument().createElement("autocompleteSingle");
|
||||
node.appendChild(autoCompleteSingles.item(i));
|
||||
node.setAttribute("url", item.getAttribute("url"));
|
||||
node.setAttribute("optionsRoot", item.getAttribute("optionsRoot"));
|
||||
autoCompletes.add(singleToMap(node));
|
||||
}
|
||||
}
|
||||
}
|
||||
dataMap.put("autocompleteSingle", autoCompletes);
|
||||
|
|
Loading…
Reference in New Issue