Fix multiList on xml export

This commit is contained in:
George Kalampokis 2020-09-11 16:54:32 +03:00
parent 2390a33a98
commit 7b800b2347
2 changed files with 4 additions and 1 deletions

View File

@ -205,6 +205,7 @@ public class ExportXmlBuilderDatasetProfile {
WordListData wordListDataObject = (WordListData) field.getData();
dataOut.setAttribute("label", wordListDataObject.getLabel());
dataOut.setAttribute("type", wordListDataObject.getType());
dataOut.setAttribute("multiList", wordListDataObject.getMultiList().toString());
Element options = element.createElement("options");
wordListDataObject.getOptions().forEach(optionChildFor -> {
Element optionChild = element.createElement("option");

View File

@ -78,7 +78,8 @@ public class WordListData extends ComboBoxData<WordListData> {
this.options.add(newOption);
}
}
this.multiList = (Boolean) ((Map<String, Object>) data).get("multiList");
Object multiList1 = ((Map<String, Object>) data).get("multiList");
this.multiList = multiList1 instanceof String ? Boolean.parseBoolean((String) multiList1) : (Boolean) multiList1;
}
return this;
}
@ -92,6 +93,7 @@ public class WordListData extends ComboBoxData<WordListData> {
@Override
public Map<String, Object> toMap(Element item) {
HashMap dataMap = new HashMap();
dataMap.put("multiList", item != null ? item.getAttribute("multiList") : "false");
dataMap.put("label", item != null ? item.getAttribute("label") : "");
dataMap.put("type", item != null ? item.getAttribute("type") : "wordlist");
Element optionsElement = (Element) item.getElementsByTagName("options").item(0);