Announcement

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

    Problem for refreshing listgrid.

    SmartGWT 3.0 nighty build

    We are using a ListGrid in our SmartGWT app. We have a bug that we haven't yet managed to fix.
    Here the steps to reproduce:
    1. I create a new empty ListGrid
    2. Then I set up the fields using the method setFields(myFields) and the records using setData(myRecords) (we don't use the Datasource, because we use only GWT RPC protocol to communicate with the server).
    3. I add a new row using the method startEditingNew(), I edit it and get the data (using getRecords()) to save it using an RPC service.
    4. I clear the grid with setData(new ListGridRecord[0]) and setFields(new ListGridFields[0]) to obtain an empty grid.
    5. Then in the same grid we load new fields and records (the fields may be different)
    -> the row added in step 3 remains in the grid!!!

    It seems the record is still in the component even though it's cleared using setData(new ListGridRecord[0])

    I've tried with the endEditing() method but without success.

    How can we correct that?
    Attached Files

    #2
    First, this is a terrible overall approach - see the FAQ for the many reasons not to use GWT-RPC, however, even if you continued to use GWT-RPC, your approach of using setData() won't accommodate large datasets, and breaks many valuable features such as Adaptive Filtering & Sort. Revise this when you can; unless your data sets are all reliably very small, you will never arrive at a shippable application with your current approach.

    So long as you either have autoSaveEdits:true or call saveEdits() manually, endEditing() should convert the editValues established by startEditingNew() to an actual Record in the dataset.

    If you can't figure out why the editValues are still around, discardEdits() would be one way to get rid of it.

    If you think there might be a framework bug here, please provide a minimal, ready-to-run test case (one that does not involve GWT-RPC).

    Comment


      #3
      Originally posted by Isomorphic View Post
      So long as you either have autoSaveEdits:true or call saveEdits() manually, endEditing() should convert the editValues established by startEditingNew() to an actual Record in the dataset.
      I want to use saveEdits() for manual saving but I am unable to find this method in ListGrid API for smartGWT 3.0.
      Please suggest remedy.

      Comment

      Working...
      X