Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Listgrid selection lost on updateCaches

    Hello,
    These are the framework used and their versions:
    1. SmartGWT version: v10.0p_2015-09-15/LGPL Development Only (built 2015-09-15)
    2. GWT version: 2.6.1
    3. Mozilla Firefox version: 24.6.0 or IE 11

    When calling updateCaches() from a datasource the binded listgrid loses its selection but not always. The only case I've found that the selection isn't lost is when updateCaches() updates only 1 record. If i call updateCaches() with a DSResponse filled with multiple records then the selection is lost. 

    To reproduce the problem just run the provided TestCase and select a record from the grid then just click the Update cache button. You'll see that the selection gets lost.

    Thank you,
    Andrei
    Attached Files

    #2
    You don't seem to have reselectOnUpdate set - this is required to maintain selection.

    While it does generally work, the multi-record update format allowed by a DSResponse is for special circumstances, and shouldn't be used for this case.

    Also don't use RootPanel.add(), use draw() (see QuickStart Guide).

    Comment


      #3
      Applying reselectOnUpdate doesn't change anything. As stated in the JavaDoc it seems that this property is always set to TRUE. In the JavaDoc for updateCaches() it doesn't say anything about multi-record update format being only for special circumstances. However we found that if we call updateCaches() in a loop with only one record set to the DSResponse the selection is working. 

      Comment

      Working...
      X