My grid have about 10 - 20 rows of Rates data , but each grid cell is a different row on the database side. So we are using pivot on db side to populate data and then Json string for the client side datasource object. I'm also using 'OperationBinding' for the datasource fetch and update operations.
When I am calling grid.SaveAllEdits, it sends update for each edited row, so in my case 10-20 times.
On the server side I am able to parse each call and correctly update DB. But now the client is expecting a Response back, and here I am not sure what to send back.
The questions are:
1. should I get all data from Request and just send it back in the Response object after successful update ? Is there a better way just to say that update is OK ?
I tried this code in my servlet to simply take all request data and return it back as a Json string :
What it's doing is adding a new row to the grid with saved info. Maybe because the data does not exactly match the row in the grid ?
2. is there a way to send all rows in one call to server, since I will update all data just once ? By using SaveAllEdits it is sending each row in separate request.
I am working with Firefox and SmartGWT 2.1
Thanks,
Gary.
When I am calling grid.SaveAllEdits, it sends update for each edited row, so in my case 10-20 times.
On the server side I am able to parse each call and correctly update DB. But now the client is expecting a Response back, and here I am not sure what to send back.
The questions are:
1. should I get all data from Request and just send it back in the Response object after successful update ? Is there a better way just to say that update is OK ?
I tried this code in my servlet to simply take all request data and return it back as a Json string :
Code:
Map<?, ?> map = request.getParameterMap(); JSONObject jso = new JSONObject(); String msg = jso.fromObject(map).toString(); mav = MVCUtils.MVCMessage(mav, msg); return mav;
2. is there a way to send all rows in one call to server, since I will update all data just once ? By using SaveAllEdits it is sending each row in separate request.
I am working with Firefox and SmartGWT 2.1
Thanks,
Gary.
Comment