That’s the right approach, but having modified the data, be sure to call setData() with it. Also, you want to declare the field in your DataSource, so that we know it’s type and title and so forth.
I use the same approach like pius, but still have some problems.
I use a DataSource to access a oracleDB and added a operationBinding to perform serverside calculations with the data i get in the response. The results should be added as new field.
However, i use setData() (suggested in the QuickstartGuide) to write the changed data back to the response but it never shows up in the client (here a ListGrid), only the fields defined in the DataSource can be accessed.
If I try to add a name for the calculated field to the DataSource i get an exception from SmartGwt because the field is not present in the database (ORA-00904).
Is there any way to define the DataSource in way that the calculated field can be accessed but prevent the DataSource from trying to fetch a field that is not present in the database? Or is there another way to get access to the calculated field?