Announcement

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

    ListGrid.filterData() missbehaviour in smartgwt 13

    Hello,

    After upgrading from SGWT 12.1 to 13 the ListGrid.filterData() method just does nothing in our application. We are using a shared DataSource with a list of TreeNodes for a TreeGrid, ListGrid and TileGrid components. All of them filter ok except the ListGrid. It must be something particular but there is no error in the stack trace. If I test it on a very simple test case it is working fine. Hence I need some help in determining what might have changed in version 13 so I can narrow down the code in order to reproduce it on a smaller test case.

    #2
    I found the source of the problem. It seems that if filterData() is called before the ListGrid is added to a component it works fine in SGWT 12.1 but not in 13. Hence I called filterData() after the ListGrid is added.

    Comment


      #3
      There's no obvious 13.0 change that would cause this, but things to clarify:

      1. do you actually draw() the component in some other context, then add it to a new component? (generally a bad idea, or at least a waste)

      2. are you seeing a request to the server, or just nothing at all?

      3. any warnings or errors?

      Comment


        #4
        The answers are:
        1. No
        2. The fetch request is made and the datasource is populated before the ListGrid becomes visible.
        3. No

        Just to make it clear... this configuration does not filter:
        Code:
        projectsGrid.filterData(new ProjectsExceptAllProjects());
        mainPanel.setMembers(projectsGrid);
        While this one does filter:
        Code:
        mainPanel.setMembers(projectsGrid);
        projectsGrid.filterData(new ProjectsExceptAllProjects());
        Both configurations work fine in SGWT 12.1. The above code is in the constructor of a component that contains the ListGrid and that becomes visible after the user presses a button. It sounds like filtering before the component was draw does not work and it sounds reasonable. In 12.1 it works even that way although it might not be a correct solution. Hence most probably it was a bad practice from our part so you can ignore the issue.

        Thank you!

        Comment


          #5
          We did some testing with the following code and the filtering worked fine (before and after adding the ListGrid to a layout).

          Code:
          final ListGrid countryGrid = new ListGrid();
          countryGrid.setWidth(550);
          countryGrid.setHeight(224);
          countryGrid.setDataSource(worldDS);
          countryGrid.setAutoFetchData(false);
          countryGrid.setShowAllColumns(true);
          
          
          final VStack vStack = new VStack(10);
          
          IButton filterButton = new IButton("Filter");
          filterButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent event) {
          Criteria criteria = new Criteria();
          criteria.addCriteria("continent", "Europe");
          countryGrid.filterData(criteria);
          vStack.addMember(countryGrid);
          }
          });
          
          vStack.addMember(filterButton);
          
          vStack.draw();
          Please, retest with the latest version of 13.0 and if you still reproduce the issue and your sample code is different, let us know.

          Regards
          Isomorphic Software


          Comment

          Working...
          X