Announcement

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

    Transferring multiple records with ListGrid.transferSelectedData()

    Hi,

    I'm trying to transfer multiple records from one databound listgrid to another. Transferring one works fine. The DataSource.executeAdd method, of the DataSource bound to the target ListGrid, receives the record and sends it to the server.
    Code:
        protected void executeAdd(final String requestId, final DSRequest request, final DSResponse response) {
    
            JavaScriptObject data = request.getData();
            ListGridRecord rec = new ListGridRecord(data);
    ......
    The problem is when I try to transfer multiple records at the same time. As my executeAdd method (above) converts the request.getData() into one ListGridRecord, rather than an array. It's probably simple, but I haven't been able to find how to convert this JavaScriptObject into a ListGridRecord[]. Does anybody know how to do this?

    Thanks,
    Alan

    #2
    Multiple records is going to result not in an array of records in a single "add" but in multiple "add" requests. These are then automatically combined into a single HTTP request when using the SmartGWT server, or, in 3.x, when using RestDataSource. This is one of many reasons why the FAQ recommends against GWT-RPC.

    Comment


      #3
      Thanks for the informative reply.

      I managed to solve my problem. It turned out that all the "adds" were actually reaching the server (I thought they were not). But hibernate was not using versioning to lock the updates. Therefore only some of the "adds" were being persisted correctly.

      All resolved, thanks guys!

      Comment

      Working...
      X