Search code examples
javagwtsmartgwt

SmartGWT: Programmatically set edit value in list grid to null for numeric field


I need to set edit value in list grid from existing value to null in numeric field. Edits come from external component and must be reflected on the grid. Filed is not required so it can have null value. I was trying the following:

1) throws an exception

Integer nullValue = null;
listGrid.setEditValue(rowNum, fieldName, nullValue);

2) look like this is working the same as clearEditValue(rowNum, "fieldName")

HashMap map = new HashMap<>();
map.put("fieldName", null);
listGrid.setEditValues(rowNum, map);

I'm using SmartGWT 6.0p


Solution

  • Found solution. Regardless of filed type I can cast null to String In this case SmartGWT is not throwing any exception and edit value is set to null

    listGrid.setEditValue(rowNum, fieldName (String)null);