Announcement

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

    TreeGrid bug when adding a record into a parentless set of data

    Hello,
    These are the framework used and their versions:
    1. SmartGWT version: v9.0p_2013-07-15/LGPL Development Only (built 2013-07-15)
    2. GWT version: 2.5.1
    3. Mozilla Firefox version: 24.0

    I have found 2 issues when working with a datasource with cacheAllData(true) but let's take them in order:
    1. The first problem appears when adding a record into a TreeGrid that is databound to a datasource with cacheAllData set to true. The record is successfully added into the datasource cache when calling updateCache() but the TreeGrid doesn't shows the new record. After many tries I managed to see that this problem is reproduced only when the TreeGrid shows a flat list of records (all of the records are siblings) and the new record is added as a sibling. When the new record is added as a child of one of the siblings then all works as expected. See the comments in WBSPanel class in the addTask() method from the test case.
    2. The second problem is that when a datasource has cacheAllData set to true and in the executeFetch method from the datasource we return the fetched data immediately without any delay then the components databounded to the datasource will not show any records. I overcomed this small problem by adding a Timer to simulate the response time from the server. This problem appeared only when trying to make the test case for you and I think it will never reproduce in a production enviroment. See the comments in TaskDataSource class in the executeFetch () method from the test case.

    How to reproduce the two problems:
    1. In the addTask() method from WBSPanel class make sure that the PARENT_UNIQUE_ID value is 1 and then in the GUI click the Add button. To make it work change the value from 1 to 4 and click add again.
    2. Remove the Timer from TaskDataSource class from executeFetch() method.

    Please find attached the test case that reproduces the problems.
    Attached Files

    #2
    Thanks for putting effort into this test case, however, please try it with the latest patched version - you're missing 3.5 months of patches.

    Comment


      #3
      I just tried with SNAPSHOT_v9.1d_2013-10-30/LGPL Development Only version from http://smartclient.com/builds/SmartGWT/4.1d/LGPL/2013-10-30 and both problems are still persisting.

      Thank you for your quick response.

      Comment


        #4
        Any new changes about these problems? As I said in the previous replay I have tried with the latest build of SmartGWT but the problems are still there.

        Comment


          #5
          The second problem (issue if you synchronously call processResponse()) has been fixed.

          The first problem is a bug in the test code. You need a call like:

          Code:
                tasksTreeGrid.setTreeRootValue(1);
          Without this call, filtering will eliminate the newly added "New Task" node because the parentId value of the node (1) did not match the assumed rootValue of the tree (null).

          Comment


            #6
            Thank you

            Thank you for resolving my first problem and I am glad that I managed to find a bug that you solved. Have a nice day :)

            Comment


              #7
              Hi again,

              I stumbled upon another bug when a TreeGrid presents a parentless set of data but this time when a filter is applied.
              Before applying the filter if I add a record into the tree it is added as expected. Then if I apply the filter and again click the add button nothing happens even if the new record complies with all the conditions imposed by the filter in order to be shown in the filtered set of data. If I change a little bit the filter to also show the parent of the tasks the new records are added as expected. Please see the attached test case.

              These are the framework used and their versions:
              1. SmartGWT version: v9.1p_2014-06-14/LGPL Development Only (built 2014-06-14)
              2. GWT version: 2.6
              3. Mozilla Firefox version: 26.0

              How to reproduce the problem:
              1. First click the Add button and you will see that a new task is added under Project 1. Also please noticed the values of the Parent column.
              2. Then that click the Filter button and only the tasks under Project 1 will be shown - also notice that the values from the Parent column had changed.
              3. Click again the Add button and you will see that nothing happens - no records are added into the filtered set of data.
              4. If you go back into the code and change the filter with the commented one it will show Project 1 AND its descendants. If you apply again the steps from 1 to 3 you will see that then all is working as expected.

              Best regards,
              Andrei
              Attached Files
              Last edited by slick07; 17 Jun 2014, 01:14.

              Comment


                #8
                From your description, it sounds like you are hoping for the behavior of "keepParentsOnFilter" - please take a look at the docs for this property.

                Comment


                  #9
                  Originally posted by Isomorphic View Post
                  From your description, it sounds like you are hoping for the behavior of "keepParentsOnFilter" - please take a look at the docs for this property.
                  Not exactly. Let me give you a full example so you can better understand the problem: let's suppose that initially my application fetches from the server and presents a data structure with a root and 3 children:
                  -root
                  ---child1
                  ---child2
                  ---child3

                  Then the user has the possibility(a setting) not to show the root. In this case I apply a filter to only show the children:
                  --child1
                  --child2
                  --child3

                  For this latest case if I want to add a new child to the tree (a brother of child3) nothing happens. I suppose that nothing it's happening because when I applied the filter the parent ids for the child1 to 3 had changed. I don't know why are they changing. Is this a bug or a feature. Please run my test case for a better understanding.

                  Comment


                    #10
                    Hi again.

                    Any new ideas of how can I make the above example to work? Also please don't forget about the provided test case that exactly exactly reproduces the problem.

                    Comment

                    Working...
                    X