Announcement

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

    #16
    Hi,

    I updated to the latest nightly build (06-30-2011). There is some improvement, but it still isn't working properly. I also found a new issue.

    CURRENT ISSUE:

    If I have setCacheAllData(true) on the datasource, now the data is fetched from the server (unlike with the previous version), however, nothing is loaded in the grid. Using Firebug, I can see the XML file content coming over to the client, but no data is loaded in the grid. This is different from the earlier behavior. Earlier, the fetch itself was not working, and the servlet was not getting called at all.

    So, there is some improvement now, but setCacheAllData(true) is still "not" working correctly.


    NEW ISSUE:

    If I have a fetch Criteria on the grid, the Criteria does "not" seem to have any effect. All the data is fetched on the grid. Here's the code for the new issue. The only modification is the addition of a Criteria to the fetchData call.

    TestDS.java (for NEW ISSUE only):
    Code:
    package com.dfb.test.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.data.Criteria;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.events.ClickEvent;
    import com.smartgwt.client.widgets.events.ClickHandler;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.grid.ListGridRecord;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class TestRestDS implements EntryPoint {
    
        public final TestXMLDS testDS = TestXMLDS.getInstance();        
    
        public void onModuleLoad() {
    
            //testDS.setCacheAllData(true); <- Commented out for testing
    
            VLayout rootLayout = new VLayout();
            rootLayout.setPadding(20);
            rootLayout.setMembersMargin(20);
                    
            final ListGrid grid = new ListGrid();  
            grid.setWidth(200);  
            grid.setHeight(300);  
            grid.setDataSource(testDS);
    
            final Criteria findName1 = new Criteria();
            findName1.addCriteria("name", "name1");
    
            IButton button1 = new IButton("Load data");
            
            button1.addClickHandler(new ClickHandler() {  
                public void onClick(ClickEvent event) {             
                    grid.fetchData(findName1);
                }  
            });
            
            IButton button2 = new IButton("Clear data");
            
            button2.addClickHandler(new ClickHandler() {  
                public void onClick(ClickEvent event) {
                    grid.setData(new ListGridRecord[] {});
                }  
            });
                    
            ListGridField field = new ListGridField("name", "Name");  
            grid.setFields(field); 
            
            rootLayout.setMembers(grid, button1, button2);
            rootLayout.draw();      
    
        }
    }
    Thanks.

    Comment


      #17
      "NEW ISSUE": with cacheAllData:false your server is sent the criteria and is expected to filter results.

      Comment


        #18
        Thanks for clarifying that. Hopefully, I won't need to do filtering on the server side once cacheAllData:true starts working correctly.

        Comment


          #19
          OK - after all those red herrings with wrong XML formats and trying to keep data secret, it turns out there *was* a bug with a cacheAllData:true DataSource that your test case was triggering, and it's now corrected for the next nightly - thanks for sticking with it.

          Comment


            #20
            I'm really glad to hear this. Was the fix in the 7/7 nightly? I tried that today, but that doesn't seem to have the fix.

            I'm not sure how I manage to hit these bugs that no one else seems bothered about. Earlier I had a scroll bar issue where I would get an unnecessary horizontal scroll bar that took several weeks to troubleshoot and resolve.

            Thanks.

            Comment


              #21
              Hi,

              I upgraded to 7/13 nightly today and the results are definitely better. The problem with data not loading with cacheAllData: true, is fixed.

              But I noticed one thing, which I think might be an issue. The cache seems to "expire" (I think "invalidated" is the right term) too soon. Here are the steps to reproduce the problem with my standalone test case:

              1. Click on Load Data. Data is loaded in the grid. (Good)
              2. Click on Clear Data. Data is cleared from the grid. (Good)
              3. Click on Load Data again. Data is retrieved from the cache. Server call is not made. (Good)
              4. Click on Clear Data again. Data is cleared from the grid. (Good)
              5. Wait for about 1 min.
              6. Click on Load Data again. Data is retrieved from the server, and NOT fetched from the cache. (Problem)

              I have verified this issue on IE 8 and Chrome 12x (latest public build).

              So, is there a time-limit after which the cache gets "invalidated"? If that's the case, it seems to be too short. Even if you are actively using the application, the cache seems to get invalidated after about a minute. This doesn't seem right to me. Is there a way to prevent this from happening. I saw APIs to invalidate the cache, but I didn't see any API to NOT invalidate the cache, other than setCacheAllData (true) itself.

              Can you confirm whether this is an issue?

              Thanks.

              Comment


                #22
                This is as designed and documented - see cacheMaxAge.

                Comment


                  #23
                  Awesome ! It's working perfectly now after setting the cacheMaxAge.

                  You can consider the issue "closed" now.

                  Thank you so much for patiently working with me to get to the bottom of the problem.

                  Comment


                    #24
                    hi how about this problem

                    http://forums.smartclient.com/showthread.php?t=17807

                    someone can help please?

                    thanks in advance

                    Comment

                    Working...
                    X