Announcement

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

    How to refresh ListGrid data only for changed rows?

    I am using smartGWT 3.0 . I am evaluating smartGWT for one project. The requirement is for refreshing ListGrid (which is linked to DataSource) only for changed rows.
    I have already gone through fetchData method but it fetches all the rows or based on row range but it does not seem possible to achieve refresh random rows using this method.
    I want to actually make a data fetch call similar to Update operation where response object just carries the set of records which needs to be refreshed.

    please provide your opinion

    #2
    DataSource.updateCaches() is what you are looking for.
    MichalG

    Comment


      #3
      API not found to setOperationType in DSResponse

      Thanks for MichalG your reply.

      I read from other sources about usage of updateCaches() method and found that I need to set operation type in new DSResponse object.

      <b> But the problem is that the smartGWT jar which i am using does not provide me the method to set operation type. I am using the 3.0 smartgwt jar. </b>

      Though I have found the setOperationType(DSOperationType operationType) in below documentation. Please help me solve this issue.

      http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/data/DSResponse.html

      Comment


        #4
        You have to set operationType for request, not response. Along with DataSource which is also supposed to be set on request.
        As far as response in concerned, it is enough to set data only.
        Something like:
        Code:
                        DSRequest changeRequest = new DSRequest();
                        changeRequest.setDataSource(dsID);
                        changeRequest.setOperationType(DSOperationType.valueOf(operationType.toUpperCase()));
        
                        DSResponse changeResponse = new DSResponse();
                        changeResponse.setData(record);
                        ds.updateCaches(changeResponse, changeRequest);
        MichalG

        Comment


          #5
          Thanks michalg for your prompt and precise answers. It worked for me.
          Though I am still unable to understand the reason behind the difference between the API JAvadoc and the actual API.

          Please help me if you have any idea about it.

          PS: I have explained this issue in detail at below thread:
          http://forums.smartclient.com/showthread.php?t=27049

          Comment

          Working...
          X