Announcement

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

    #16
    Sorry, not a possibility: Support doesn't dive into your code and start analyzing if there's no suggestion of a framework bug.

    If you want problems looked into regardless of the cause, including just ordinary coding errors on your part, you can use our Consulting services (which works on an hourly basis).

    Comment


      #17
      There is a bug in the framework

      There is a bug in the framework, as I said before, I can paste the DataSource definition, the tree instantiation and the JSON data that is returned from the server.

      I can't provide a working test case because this problem occur when working with a server.

      Comment


        #18
        That's an interesting belief, but, as we've explained at length, your attempts to show this to be a framework bug have all failed, with a great deal of time spent on a bogus report..

        The fact that the interaction involves a server does not in any way prevent the preparation of a minimal test case. Typically, a client-only DataSource is used unless the problem specifically involves server logic, in which case the server logic can be provided too, typically by modifiying a sample.

        Comment


          #19
          The previous times I indicated that there is a bug I manage to prove it so I am not 100% sure that this is a framework bug but the odds are pretty good.

          I will try to reproduce it again with client only test case because I am very curious to know where is the problem.

          Comment


            #20
            So, in order to not waste anymore time I did everything I can to reproduce the problem with as fewer actions as possible on yours behalf.

            I downloaded the latest nightly build "SmartClient_v83p_2013-02-24". I opened this file "SmartClient_v83p_2013-02-24\smartclientSDK\isomorphic\system\reference\inlineExamples\trees\dataBinding\employeesDataChildrenArrays.xml" and changed it to this (notice that I only changed 'Charles Madigen' to 'Charles Madigen 4' and added the isOpener tag)

            Code:
            <Employees>
                <employee>
                    <Name>Charles Madigen 4</Name>
                    <Job>Chief Operating Officer</Job>
                    <isOpener>true</isOpener>
                    <directReports>
                        <employee>
                            <Name>Rogine Leger</Name>
                            <Job>Mgr Syst P P</Job>
                            <directReports></directReports>
                        </employee>
                        <employee>
                            <Name>Gene Porter</Name>
                            <Job>Mgr Tech Plng IntIS T</Job>
                            <directReports>
                                <employee>
                                    <Name>Olivier Doucet</Name>
                                    <Job>Asset Spec Lines Stns</Job>
                                    <directReports></directReports>
                                </employee>
                                <employee>
                                    <Name>Cheryl Pearson</Name>
                                    <Job>Dsl Sys Rep</Job>
                                    <directReports></directReports>
                                </employee>
                            </directReports>
                        </employee>
                    </directReports>
                </employee>
            </Employees>
            Then, I run this code
            Code:
            isc.DataSource.create({
                ID:"employees",
                dataURL:"/isomorphic/system/reference/inlineExamples/trees/dataBinding/employeesDataChildrenArrays.xml",
                recordXPath:"/Employees/employee",
                fields:[
                    {name:"Name"},
                    {name:"Job"},
            {name:"isOpener", type: "boolean"},
                    {name:"directReports", childrenProperty:true}
                ]
            });
            
            isc.VLayout.create({
            
            members: [
            
            isc.TreeGrid.create({
                ID: "employeeTree",
                dataSource: "employees",
                autoFetchData: true,
            dataProperties: {
            openProperty: "isOpener"
            },
                // customized appearance
                width: 500,
                height: 400,
                nodeIcon:"icons/16/person.png",
                folderIcon:"icons/16/person.png",
                showOpenIcons:false,
                showDropIcons:false,
                closedIconSuffix:""
            })
            
            ,
            
            isc.Label.create({
            contents: 'Fetch',
            click: function() {
            employeeTree.fetchData({ d: new Date()})
            }})]});
            This first time the tree is loaded the first node is open, then I press the fetch and the node is close. When I remove the
            Code:
             openProperty: "isOpener"
            and enter
            Code:
             isOpen:function (node) {
                    return this.Super('isOpen', node) || node.isOpener;
                  }
            it works like a charm.

            Believe me that you have a bug in the framework here. You may fixed it already but in the latest nightly build you still have it. Please try to reproduce it with the latest nightly build as I do and I'm 100% sure you will be able to see the bug.

            Sorry for insisting but I don't want to use code that you don't approve.

            Comment


              #21
              Have to managed to take a look at this?

              Comment


                #22
                So it looks like what you've done in this new test case is shifted to a set of sample data with no identifiers for the nodes - there's no primaryKey declared, and no Tree.nameProperty declared either (the fact that there's a field called "Name" is not sufficient).

                In this situation, when data is loaded a second time, the tree attempts to re-apply the open state that previously existed, but doesn't have a reliable basis for identifying nodes, so this doesn't work.

                Adding either a primaryKey field or an explicit declaration of nameProperty:"Name" fixes this.

                Note that your isOpen() override isn't really "fixing" isOpen(). The important effect is that, by removing the "openProperty" setting, you make it so that the tree does not try to assign to "isOpener" when it re-applies the previous openState.

                We'll look at whether there's something the Tree could do better here in the absence of IDs or names for nodes, but, probably not. The solution is really to get your usage fixed.

                Comment


                  #23
                  Great! Now it working :)

                  Thank you for going over this. I think that a simple 'You must declare nameProperty or primaryKey' note in the openProperty documentation will be suffice.

                  Comment


                    #24
                    Well, I only managed to make it work with nameProperty but not with primaryKey:true.

                    I added primaryKey:true to the name field but it didn't work and even added a new field name id with numeric unique value but it didn't work either. Can you please take a loot at this?

                    Comment


                      #25
                      You do not appear to have shared anything for us to look into.

                      You already have the sample you originally posted, which has primaryKeys and works.

                      Comment


                        #26
                        The last example I added doesn't have primary key. Please try this with the XML I added before.

                        As you can see, all I did here is to add primaryKey:true to the name field when creating the DS. This doesn't work.

                        Code:
                          isc.DataSource.create({
                            ID:"employees",
                            dataURL:"/isomorphic/system/reference/inlineExamples/trees/dataBinding/employeesDataChildrenArrays.xml",
                            recordXPath:"/Employees/employee",
                            fields:[
                              {name:"Name", primaryKey:true},
                              {name:"Job"},
                              {name:"isOpener", type: "boolean"},
                              {name:"directReports", childrenProperty:true}
                            ]
                          });
                        
                          isc.VLayout.create({
                        
                            members: [
                        
                              isc.TreeGrid.create({
                                ID: "employeeTree",
                        primaryKeyField: "Name",
                                dataSource: "employees",
                                autoFetchData: true,
                                dataProperties: {
                                  openProperty: "isOpener",
                                },
                                // customized appearance
                                width: 500,
                                height: 400,
                                nodeIcon:"icons/16/person.png",
                                folderIcon:"icons/16/person.png",
                                showOpenIcons:false,
                                showDropIcons:false,
                                closedIconSuffix:""
                              })
                        
                              ,
                        
                              isc.Label.create({
                                contents: 'Fetch',
                                click: function() {
                                  employeeTree.fetchData({ d: new Date()})
                                }})]});

                        Comment


                          #27
                          That's because you would want to set nameProperty:"Name" on the dataProperties, not declare the Name as a primaryKey.

                          Comment


                            #28
                            In your post from the 26th Feb 2013 16:18 you said, and I quote: " - Adding either a primaryKey field or an explicit declaration of nameProperty:"Name" fixes this. - "

                            So why what I did isn't enough?

                            Comment


                              #29
                              PK is sufficient in a parent-linked dataset, Name is sufficient in childrenProperty-based dataset (see Tree ModelType).

                              Comment


                                #30
                                Ok, now I see and understand the whole picture.

                                Thank you.

                                Comment

                                Working...
                                X