Announcement

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

    Grouping by a field that has a display column issue

    I do my grouping on a column that has a option datasource for the display field.
    If I do a grouping on this column before the display field is resolved the grouping description show the value field and not the display field.
    Is there a way to get notified when the option datasource has fetched all his values? (And do the grouping after that)

    N.B. It is quite strange, this is working in eclipse under jetty, but not under tomcat where it takes about 7 seconds to display the display field.

    #2
    There isn't a direct notification API for when this data is loaded.

    However, you can take advantage of the fact that the ListGrid automatically combines field.optionDataSource fetches with the primary fetchData() call if autoFetchData is true, so, the first time DataArrived fires you know that the ListGrid is in the midst of (synchronously) processing all the responses.

    If you schedule a zero-millisecond timer from there, it will definitely fire after all the optionDataSource data has loaded.

    Comment


      #3
      Sorry, I don't understand..
      The DataArrivedHandler on the grid is executed before the options are loaded.
      I tried it with AutoFetchData on and off.

      I used the following code for the (com.google.gwt.user.client) timer:

      Code:
      reportGrid.addDataArrivedHandler(new DataArrivedHandler() {
        @Override
        public void onDataArrived(DataArrivedEvent event) {
          nextButton.enable();
          Timer timer = new Timer()
          {
            @Override
            public void run()
            {
              reportGrid.groupBy("account");
            }
          };
          timer.schedule(0);
        }
      });

      Comment


        #4
        The ListGrid uses Queuing to group together the requests (see the Queuing section in the QuickStart Guide).

        If you are using some integration approach that doesn't support queuing, the approach we suggested wouldn't work. You should probably switch over to an approach that does support queuing.

        Alternatively, you could add a ResponseTransformer to your optionDataSources so you could detect that they have just completed a fetch, but this is a much worse approach and being able to use queuing has lots of other benefits.

        Comment


          #5
          My grid datasource and the option datasource are both 'dmi' datasources.
          I have tested with autofetch, but checking the Developer Console I do not see any queuing happening.

          The addition of RPCManager startQueue and sendQueue however does fix the issue.

          Comment


            #6
            We're not sure how you could avoid the automatic queuing that the ListGrid does - if you could show a test case that reproduces that problem it would be great, but since you've got a solution, we'll understand if you don't want to bother.

            Comment

            Working...
            X