In a my applications I have defined a property of an object as a LinkedHashSet. The property I fill with values from a multi-value field:
Vector<String> ctrs = doc.getItemValue("countries");
LinkedHashSet<String> items = new LinkedHashSet<String>();
for (int i = 0; i < ctrs.size(); i++){
items.add(ctrs.get(i));
}
employee.setCountry(items);
On an XPage I would like to display the values as followed:
<xp:inputText id="inputCountries" value="#{employeeBean.employee.Country}">
<xp:this.multipleSeparator><![CDATA[#{javascript:var val = getComponent("contractType").getValue();
if (val == "Multi"){
return ",";
}}]]></xp:this.multipleSeparator>
</xp:inputText>
Depending on the type of employee this field may be single or multi-value.
When view the XPage the returned value is displayed as followed:
[Sweden, Denmark, Estonia]
Ofcourse I would have it displayed as multi-value. What should I do to correct this?