Announcement

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

    #16
    Originally posted by Isomorphic
    A DataSource with clientOnly:true is simulating a server-side store. Calling setTestData() is like having the complete dataset change on the server: the grid doesn't know about it and believes it has a complete cache.

    To get rid of your cache, call setData() with an empty array, then call fetchData() again.
    Hmm now I understand.. so it is not possible to have the list grids/forms that use a datasource to be automatically notified of data changes without buying a license?
    I mean listGrid.setAutoFetchData(true); that is responsible for this will never work actually with the open source free license?

    Comment


      #17
      Originally posted by mihai007
      Hmm now I understand.. so it is not possible to have the list grids/forms that use a datasource to be automatically notified of data changes without buying a license?
      I mean listGrid.setAutoFetchData(true); that is responsible for this will never work actually with the open source free license?

      they are notified of changes from dataServer.addData() .removeData(), not from setTestData()

      I think the latter was intended only for a test use in loading data at the start.

      Comment


        #18
        humm ok, now I am trying with addData() instead and it works in clientOnly but now as I am using RPC I need a way to get the data from the datastore so that I could send it using my RPC.
        Now getTestData() does not work anymore since I am using addData() on the datastore.
        There is no equivalent getData() method, what could I use instead?

        Comment


          #19
          This has nothing to do with the free vs commercial version, both versions behave identically for clientOnly DataSources.

          autoFetchData simply does what the docs say (calls fetchData() on draw) and it's behavior doesn't differ between clientOnly and other types of DataSources.

          setTestData() is the right way to populate a clientOnly DataSource from a GWT-RPC service and addData() is not really appropriate. Just be sure to understand: if you have a component bound to a clientOnly DataSource and it has already fetched data, setTestData won't cause it to automatically refresh.

          This means that you're using a GWT-RPC service to populate a client-only DataSource, don't call fetchData() (and don't allow the component to draw with autoFetchData set) until you have called setTestData() to populate the DataSource.

          If you are needing to call setTestData() multiple times, after you have already fetched data, you can use the methods below (setData to empty then fetchData()).

          Note that Calendar does have a fetchData() API but it's missing in SmartGWT, will be added shortly but can be called now via JSNI.

          Finally, remember that this whole clientOnly DataSource thing is a temporary workaround for people who have existing GWT-RPC services. Starting from scratch, RestDataSource is better (and SmartGWT EE *much* better). Also, support for cleaner integration with GWT-RPC services is also coming.

          Comment


            #20
            Originally posted by Isomorphic
            Starting from scratch, RestDataSource is better (and SmartGWT EE *much* better). Also, support for cleaner integration with GWT-RPC services is also coming.
            In our case RestDataSource is not optimal because:
            1) our data are pretty structured and don't apply well with rest architecture.
            2) security conserns
            3) it's much easier to create/debug gwt-rpc calls than an external rest server.

            Of course 1 and 2 can be managed also with rest services, but doing it only for the sake of RestDataSource doesn't make the bill IMHO.
            Also we're waiting for SmartGWT EE.

            Comment

            Working...
            X