Problem with refreshing the values in the list grid

Hi,

We have a requirement to add an row to a listgrid from a pop-up that would appear on click of a button.
The new row has to be inserted to the middle of the listgrid(lstGrd) .
For that, I have a javascript array(lstTemp) to which will add all the rows that are presently in the listgrid. Then I will put the new row into this javascript array and do,

lstGrd.setData(lstTemp);

Now, I have to do some calculations on the values that are appearing in these cells. For that I take all the values in the list grid to my servlet class and set it back to the response after doing the calculations.
I do it by,

lstGrd.updateData(); in the js
and
dSResponse.setData(lstCalc); in the servlet

where lstCalc contains the calculated values and is an ArrayList of transfer objects.

The problem I face here is that, even if I have all the values that are to be displayed in the lstCalc, those values are not getting reflected on the screen.
This functionality is working if I don’t add any row from the pop-up.
Only if I add a row from the pop-up, the whole lstGrd is not getting refreshed.

I tried giving lstGrd.data.invalidateCache() and lstGrd.setData(), but both did not help.

Please let me know the solution for this as soon as possible, since this is a bit of urgent requirement.

Thanks,
Vini

Hi Vini,

If you call setData() on a ListGrid with an Array of records, that’s what’s going to be displayed. We’d recommend using Log.echo()/Log.echoAll() and related methods discussed in the Debugging topic to verify that the dataset you are passing to the ListGrid has the data you expect, and also that you are not making subsequent calls to replace it with something empty or stale.