The format in which you are populating the options is wrong. The options for selction should be in the following format
[
{
"value": 10,
"text": "A"
}, {
"value": 20,
"text": "B"
}
]
Try to generate the above format like this
StringWriter writer = new StringWriter();
TidyJSONWriter json = new TidyJSONWriter(writer);
json.array();
/* loop through your options and create objects as shown below */
json.object();
json.key("text");
json.value("A");
json.key("value");
json.value(10);
json.endObject();
json.object();
json.key("text");
json.value("B");
json.key("value");
json.value(20);
json.endObject();
/* end your array */
json.endArray();
response.getWriter().write(writer.toString());
Your selection widget would then display the json in the dropdown.