Hello everyone!
SmartGWT Version: 2.5
I am trying to create a listgrid containing editable checkboxes. Following the SmartGWT-Showcase I use this statement
field.setType(ListGridFieldType.BOOLEAN)
in order to show a checkbox in the listgrid.
Unfortunately, in our database (Oracle) boolean values stored as -1 (true) and 0 (false). Thus I use a custom SELECT-statement in the datasource with an decode-statement to receive true and false instead of -1 and 0:
decode(sk_is_bookable, -1, true, false) as sk_is_bookable_bool.
This works fine so far. The trouble starts trying to save the changed values.
To make sure the database get the right values, I use the following:
field.setEditValueParser(new CellEditValueParser() { // parsing });
The parsing also works fine, but when listgrid.saveAllEdits() is called, the criteria of the SQL-Statement are all messed up. Instead of updating just the edited row, a SELECT COUNT(*) with SK_IS_BOOKABLE = ‘-1’ is called resulting in a stack-overflow-exception.
Any suggestions?