JsonBuilder selection = new JsonBuilder();
try {
selection.object();
getProvider().toJson(value, selection);
selection.endObject();
} catch (JSONException e) {
throw new RuntimeException("Error converting model object to Json", e);
}
response.render(OnDomReadyHeaderItem.forScript(JQuery.execute("$('#%s').select2('data', %s);",
getJquerySafeMarkupId(), selection.toJson())));