Announcement

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

    How to update grid from server-side

    Hi,

    I hope this is not a FAQ. But I haven't found a solution for that.

    How do I update a grid when a new item is ready on the server? I have a long running process and I'd like to display live results.

    Thanks,
    Gary

    #2
    See DataSource.updateCaches().

    Comment


      #3
      Thanks for a quick reply. But I'm new to SmartGWT and I'm not sure how to call this method on a server-side. I'm still confused where to work with a client data source and where with a server one.

      I've just tried a Spring-based server-side job regularly updating a grid. So how should I call the updateCaches() from such a server job?

      Thank you.

      Comment


        #4
        Start by reading the QuickStart Guide, especially the Server Framework chapter, to gain an understanding of the client and server parts of SmartGWT.

        Comment


          #5
          I've read that. But now I need some help how to call this method. So is it possible to cal it from a server? Do you have some example?

          Comment


            #6
            You've provided too little information to suggest a general approach, but you should look at the server-side API DSResponse.addRelatedUpdates().

            Comment


              #7
              If I understand correctly I have to have a client request first to use DSResponse.addRelatedUpdates(). But I have a different use-case. I just need to update a grid let's say every 10 seconds (or every time the server has a new row).

              Comment


                #8
                Should I use the com.google.gwt.user.client.Timer class to poll the server or is there a better way?

                Comment


                  #9
                  Polling is one approach and is usually the best approach if immediate delivery is not important.

                  When you need low-latency deliver, SmartGWT offers the Real-Time Messaging module as well (see smartclient.com/product), which does server push. You could also use some kind of third-party server-push approach.

                  Comment

                  Working...
                  X