Column<Dto, Object> column = field.getColumn(fieldName, viewMode, new Callback<Object>() {
@Override
public void callback(final Object arg) {
// TODO do as much as possible of this code in the presenter to make sure this can be tested.
if (arg instanceof QuicksearchValue) {
QuicksearchValue q = (QuicksearchValue) arg;
JsArrayString o = q.getReturnValue().cast();
final Long id = NumberParser.convertToLong(o.get(1));
final String name = o.get(0);
final String productCode = o.get(2);
final String price = o.get(3);
q.getDto().set("productID", id);
q.getDto().set("productCode", productCode);
q.getDto().set("price", price);
if (null == q.getDto().get("productID_resolved")) {
q.getDto().set("productID_resolved", new Dto("Product"));
}
final Dto resolved = (Dto) q.getDto().get("productID_resolved");
resolved.setId(id);
resolved.set("name", name);
provider.refresh();
}