Announcement

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

    removeSelectedData vs removeData

    I have a master-details type of setup and if I delete the record via the details form via the removeData call to the data source, just the primary key gets passed over on the request (excellent).

    However if I perform a deletion form the list grid by calling removeSelectedData (even if only 1 row is selected) the request contains the full data of the record instead of just the primary key. Is there someway to have the removeSelectedData to only send the primary key over in the same fashion as the removeData call?

    Here is the request from the removeData:
    Code:
    {
        dataSource:"history", 
        operationType:"remove", 
        data:{
            sysId:"8e3fb9f54bd04ae1afae628b2ece8ee6"
        }, 
        willHandleError:true, 
        showPrompt:true, 
        oldValues:{
            sysId:"8e3fb9f54bd04ae1afae628b2ece8ee6"
        }, 
        requestId:"history$6279", 
        fallbackToEval:false, 
        lastClientEventThreadCode:"TMR0", 
        bypassCache:true
    }
    and in comparison, here is the request from the removeSelectedData from the list grid:
    Code:
    {
        dataSource:"history", 
        operationType:"remove", 
        componentId:"isc_HistoryList_0", 
        data:{
            summary:null, 
            isVersion:false, 
            sysUpdatedOn:"2014-02-19 10:59:38 -0500", 
            type:2, 
            endTime:"2014-02-19 10:59:38 -0500", 
            startTime:"2014-02-19 10:58:58 -0500", 
            statusCode:200, 
            sysCreatedBy:"ops.system", 
            opswiseGroups:null, 
            name:"Ops - Sleep 40", 
            waitForExclusive:false, 
            lateFinish:false, 
            sysUpdatedBy:"ops.system", 
            earlyFinish:false, 
            taskId:"da61f058c0a80165010ec4651c083b1d", 
            sysCreatedOn:"2014-02-19 10:59:38 -0500", 
            sysModCount:0, 
            exitCode:"0", 
            agent:null, 
            lateStart:false, 
            invokedBy:"Workflow: AAA - Workflow of Sleep Tasks", 
            waitForResources:false, 
            taskRefCount:4, 
            statusDescription:null, 
            duration:"39 Seconds", 
            sysId:"6b4158d122714e76aca158488c7e2e14", 
            durationSeconds:39, 
            sysTableName:"ops_history", 
            triggerId:null, 
            execId:"8ed00daa43094dc2a94ede2648c37d4d", 
            securityName:"Ops - Sleep 40"
        }, 
        willHandleError:true, 
        showPrompt:true, 
        prompt:"Deleting Record(s)...", 
        oldValues:{
            summary:null, 
            isVersion:false, 
            sysUpdatedOn:"2014-02-19 10:59:38 -0500", 
            type:2, 
            endTime:"2014-02-19 10:59:38 -0500", 
            startTime:"2014-02-19 10:58:58 -0500", 
            statusCode:200, 
            sysCreatedBy:"ops.system", 
            opswiseGroups:null, 
            name:"Ops - Sleep 40", 
            waitForExclusive:false, 
            lateFinish:false, 
            sysUpdatedBy:"ops.system", 
            earlyFinish:false, 
            taskId:"da61f058c0a80165010ec4651c083b1d", 
            sysCreatedOn:"2014-02-19 10:59:38 -0500", 
            sysModCount:0, 
            exitCode:"0", 
            agent:null, 
            lateStart:false, 
            invokedBy:"Workflow: AAA - Workflow of Sleep Tasks", 
            waitForResources:false, 
            taskRefCount:4, 
            statusDescription:null, 
            duration:"39 Seconds", 
            sysId:"6b4158d122714e76aca158488c7e2e14", 
            durationSeconds:39, 
            sysTableName:"ops_history", 
            triggerId:null, 
            execId:"8ed00daa43094dc2a94ede2648c37d4d", 
            securityName:"Opswise - Sleep 40"
        }, 
        requestId:"history$62710", 
        fallbackToEval:false, 
        dataPageSize:100, 
        dataFetchMode:"paged", 
        lastClientEventThreadCode:"TMR0", 
        bypassCache:true
    }
    I am using 4.1 SmartGWT

    #2
    I still see this behaviour using:

    Isomorphic SmartClient/SmartGWT Framework (v9.1p_2014-07-06/Pro Deployment 2014-07-06)

    Any ideas?

    Comment


      #3
      A call to dataSource.removeData(listGrid.getSelectedRecords()) should behave as you describe. Will that work for you?

      Regards
      Isomorphic Software

      Comment


        #4
        We've now made a change to removeSelectedData which will make it behave like the datasource removeData method and trim the request down to primary key fields.

        This will be available in a nightly 10.0 build in a day or two. Until you upgrade you will still need to use the workaround posted previous.

        Regards,
        Isomorphic Software

        Comment


          #5
          Thank you kindly.

          Comment


            #6
            Is there a way to send the entire record by any chance? Either in ListGrid.removeSelected() or DataSource.removeData() would work for us.

            Comment


              #7
              The entire record is already available as dsRequest.oldValues. If you mean that you want to modify the request so that the entire record is also included as dsRequest.data, you could copy the additional fields from oldValues to dsRequest.data, either client-side in DataSource.transformRequest, or server-side in a DMI.

              Comment


                #8
                We're observing something different here using SmartClient Version: v10.0p_2014-12-09/Enterprise Deployment (built 2014-12-09)
                this is the request:
                Code:
                {
                    dataSource:"jenm_keys", 
                    operationType:"remove", 
                    data:{
                        id:"mil.jenm.data.bean.Crypto_BPC2133755323"
                    }, 
                    textMatchStyle:"exact", 
                    showPrompt:true, 
                    oldValues:{
                        id:"mil.jenm.data.bean.Crypto_BPC2133755323"
                    }, 
                    requestId:"jenm_keys$6275", 
                    fallbackToEval:false, 
                    lastClientEventThreadCode:"MUP7", 
                    bypassCache:true
                }
                it looks like only the primary key is there for both ListGrid.removeSelectedData() and DataSource.removeData(). Our DataSource has other fields besides PK that the backend needs unfortunately. Is there an easy way to send the entire Record?

                Comment


                  #9
                  Your build pre-dates the fix (see #4 above).

                  Comment


                    #10
                    I think version v10.0p_2014-12-09/Enterprise Deployment (built 2014-12-09) includes the change to removeSelectedData since both ListGrid.removeSelectedData() and DataSource.removeData() behave the same way for us. I was thinking may be do a custom operation that would delete the record, construct a related "remove" update and include it into DSResponse. Would that be the best way to send the entire Record over?

                    Comment


                      #11
                      ListGrid.removeSelectedData() automatically includes oldValues (once you've got the patched version). DataSource.removeData() is a lower-level API and does not automatically include oldValues unless you explicitly say to, which you can do via the requestProperties argument.

                      Comment

                      Working...
                      X