Announcement

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

    SGWT.mobile - Successive DynamicForm.fetchData with same Criteria

    Hi,

    Performing a first DynamicForm.fetchData(Criteria), then a second with exactly the same Criteria. The second one does not trigger any SQL statement in the log, hence does not update any data, because it is apparently assuming it does not need to fetchData since the Criteria has not changed, which is wrong since data in the DB may have changed between the two fetch.

    My form is set to FetchMode.BASIC and I am using SGWT.mobile 2013-01-18 (cannot test with 2013-01-20 since my application does not even start since 2013-01-19 on, see other post).

    My workaround at this time is to add a dummy criterion (always true) with a randomly chosen value to make sure criteria is different each time and that fetch is actually performed, but this is not very clean ...

    Code:
    ac.addCriteria("id",OperatorId.GREATER_THAN,Math.random());
    Thanks for your help, Ben.
    Last edited by bda@n-side.com; 21 Jan 2013, 02:54.

    #2
    Even forcing .invalidateCache or clearValues() before fetchData does not solve my problem

    Comment


      #3
      Any follow-up please ?

      Comment


        #4
        From docs it sounds that adequate server response should be used to get what you want:

        Data Paging with partial cache
        ...
        If concurrent modifications by other users are allowed, generally the server should set invalidateCache to clear the cache when concurrent modification is detected.

        MichalG

        Comment


          #5
          Thanks for your comment michalg, however this is not the point. I don't want to use paging (that's why I use BASIC) but I want that a fetchData(c) do perform a server request even if data have already been loaded and c has not changed. Actually this behavior of not performing the second fetch when criteria has not changed appeared only recently, before I did not have that problem.

          Comment


            #6
            This was caused by over zealous caching (ListGrids should behave this way, but not DynamicForm). Fixed for tomorrow's build.

            Comment


              #7
              Ok, thanks for the fix. Just to make sure, in any case (Grids & Forms) a call to invalidateCache should force to retrieve the full data from the server right ?

              Comment


                #8
                There isn't really a "cache" on a form, so use fetchData() there. For a grid, yes, invalidateCache should cause an automatic re-fetch if the grid is visible.

                Comment

                Working...
                X