Announcement

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

    Paged TreeGrid producing multiple fetch requests

    I am not quite sure what I am doing wrong, but for some reason TreeGrid.fetchData is producing 3 fetch requests.

    Code:
    public class ArchiveTree extends TreeGrid
    {
        public ArchiveTree()
        {
            setShowConnectors(true);
            setLeaveSelectionCheckboxGap(false);
            setHeight(269);
            setSelectionType(SelectionStyle.SIMPLE);
            setSelectionAppearance(SelectionAppearance.CHECKBOX);
    
            Tree tree = new Tree();
            tree.setModelType(TreeModelType.PARENT);
    
            tree.setIdField("absolutePath");
            tree.setParentIdField("parent");
            tree.setIsFolderProperty("directory");
            tree.setShowRoot(false);
            tree.setDefaultIsFolder(true);
            setDataProperties(tree);
    
    
    
            TreeGridField name = new TreeGridField("name", "Archive");
            TreeGridField size = new TreeGridField("size", "Size");
            setFields(name, size);
    
            if(DataSources.MISSION_ARCHIVE != null)
                setDataSource(DataSources.MISSION_ARCHIVE);
            setLoadDataOnDemand(true);
            setTreeRootValue("/data/missions/");
            setDataFetchMode(FetchMode.PAGED);
        }
    }
    invoking fetchData results in the following requests
    Code:
    {
        dataSource:"missionArchive", 
        operationType:"fetch", 
        componentId:"isc_ArchiveTree_0", 
        data:{
            parent:"/data/missions/"
        }, 
        startRow:0, 
        endRow:75, 
        textMatchStyle:"exact", 
        resultTree:[ResultTree ID:isc_ResultTree_0 (dataSource: missionArchive, created by: isc_ArchiveTree_0)], 
        callback:{
            caller:[ResultTree ID:isc_ResultTree_0 (dataSource: missionArchive, created by: isc_ArchiveTree_0)], 
            methodName:"loadChildrenReply"
        }, 
        willHandleError:true, 
        showPrompt:true, 
        prompt:"Finding Records that match your criteria...", 
        oldValues:{
            parent:"/data/missions/"
        }, 
        requestId:"missionArchive$6278", 
        internalClientContext:{
            parentNode:{
                absolutePath:"/data/missions/", 
                children:[ResultSet ID:isc_ResultSet_9(dataSource: missionArchive, created directly)], 
                childCount:190, 
                directory:true
            }, 
            relationship:{
                childDS:[DataSource ID:missionArchive], 
                parentDS:[DataSource ID:missionArchive], 
                parentIdField:"parent", 
                idField:"absolutePath"
            }, 
            childrenReplyCallback:{
            }, 
            fetchCount:1
        }, 
        fallbackToEval:false, 
        dataFetchMode:"paged", 
        lastClientEventThreadCode:"XRP3", 
        bypassCache:true
    }
    Code:
    {
        dataSource:"missionArchive", 
        operationType:"fetch", 
        componentId:"isc_ArchiveTree_0", 
        data:{
            parent:"/data/missions/"
        }, 
        textMatchStyle:"exact", 
        resultTree:[ResultTree ID:isc_ResultTree_0 (dataSource: missionArchive, created by: isc_ArchiveTree_0)], 
        callback:{
            caller:[ResultTree ID:isc_ResultTree_0 (dataSource: missionArchive, created by: isc_ArchiveTree_0)], 
            methodName:"loadChildrenReply"
        }, 
        willHandleError:true, 
        showPrompt:true, 
        prompt:"Finding Records that match your criteria...", 
        oldValues:{
            parent:"/data/missions/"
        }, 
        requestId:"missionArchive$6279", 
        internalClientContext:{
            parentNode:{
                absolutePath:"/data/missions/", 
                children:[ResultSet ID:isc_ResultSet_9(dataSource: missionArchive, created directly)], 
                childCount:190, 
                directory:true
            }, 
            relationship:{
                childDS:[DataSource ID:missionArchive], 
                parentDS:[DataSource ID:missionArchive], 
                parentIdField:"parent", 
                idField:"absolutePath"
            }, 
            childrenReplyCallback:{
            }, 
            fetchCount:2
        }, 
        fallbackToEval:false, 
        dataFetchMode:"paged", 
        lastClientEventThreadCode:"XRP3", 
        bypassCache:true
    }
    Code:
    {
        dataSource:"missionArchive", 
        operationType:"fetch", 
        componentId:"isc_ArchiveTree_0", 
        data:{
            parent:"/data/missions/"
        }, 
        textMatchStyle:"exact", 
        resultTree:[ResultTree ID:isc_ResultTree_0 (dataSource: missionArchive, created by: isc_ArchiveTree_0)], 
        callback:{
            caller:[ResultTree ID:isc_ResultTree_0 (dataSource: missionArchive, created by: isc_ArchiveTree_0)], 
            methodName:"loadChildrenReply"
        }, 
        willHandleError:true, 
        showPrompt:true, 
        prompt:"Finding Records that match your criteria...", 
        oldValues:{
            parent:"/data/missions/"
        }, 
        requestId:"missionArchive$62710", 
        internalClientContext:{
            parentNode:{
                absolutePath:"/data/missions/", 
                children:[ResultSet ID:isc_ResultSet_9(dataSource: missionArchive, created directly)], 
                childCount:190, 
                directory:true
            }, 
            relationship:{
                childDS:[DataSource ID:missionArchive], 
                parentDS:[DataSource ID:missionArchive], 
                parentIdField:"parent", 
                idField:"absolutePath"
            }, 
            childrenReplyCallback:{
            }, 
            fetchCount:3
        }, 
        fallbackToEval:false, 
        dataFetchMode:"paged", 
        lastClientEventThreadCode:"TMR4", 
        bypassCache:true
    }
    The datasource is a custom datasource, and I am unsure what the last two requests being generated are for exactly? They seem unnecessary, as the first request has not yet returned any results, and the last two do not provide start and end rows. What am I missing here, as datasource ends up sending the entire top level to the last two requests which is exactly what I am trying to avoid.

    #2
    Why is idField/parentIdField/rootValue declared via dataProperties? This should be declared on the DataSource using the foreignKey property - see the Tree DataBinding overview for details.

    Comment


      #3
      I am not the original author, but likely because your examples dont have a ds.xml. However, moving those settings to the ds.xml does not preclude the three requests from happening.

      Comment


        #4
        Using the dev console with the huge tree example here : http://www.smartclient.com/smartgwtee/showcase/#tree_paging_for_children

        I am seeing the exact same behavior with one paged request and two subsequent requests that pull the entire tree down.

        Comment


          #5
          We did see the problem you reported in the SGWT EE Showcase that was deployed to our website. However, that image was built and deployed back in 10/2014. We've deployed a new version and it doesn't exhibit the issue any more.

          Therefore, we believe that updating to the latest downloadable version of SGWT for the branch you're using will solve the issue. However, you never provided your SGWT version. What is the exact version - branch and date stamp - that you're using?

          Comment


            #6
            We are currently using SmartClient Version: v9.1p_2015-01-24/PowerEdition Deployment (built 2015-01-24)

            I pulled the Jan 29 build and it still behaves similarly
            Last edited by jpappalardo; 29 Jan 2015, 08:12.

            Comment


              #7
              This was fixed back in 12/2014 for the SGWT 5.1d and 5.0p branches, but the fix didn't make it into SGWT 4.1p.

              We're applying it to SC 9.1p/SGWT 4.1p now and it should be in the nightly builds available tomorrow.

              Comment


                #8
                Thank you.

                Comment

                Working...
                X