Originally posted by Isomorphic
I want the formatter to return using these values (displayValue+"-"+value) should I do it another way?
Should I be using the record or something else instead inside that Formatter?
return item.getDisplayValue() + " - " + item.getValue();
You also stated :
Originally posted by Isomorphic
Currently I still get the error but it eventually shows on the screen using this code , however it seems to be appending over and over again...(I've tried every variation and looked through the forum as to how I need to set the formatter properly but to no avail)
Code:
FormItemValueFormatter xmlidFmt = new FormItemValueFormatter() {
@Override
public String formatValue(Object value, Record record, DynamicForm form, FormItem item) {
if(value == null) return "";
String tmp = value.toString();
if(item.getDisplayValue() != null && item.getDisplayValue().trim().length() > 0) {
tmp = item.getDisplayValue() + " - " + value;
}
return tmp;
}
};
SelectItem tmp = new SelectItem("xmlid");
tmp.setValueFormatter(xmlidFmt);
df.setFields(tmp);
Comment