Announcement

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

    #16
    Sorry, again, to look any further at this, we need code that we can run that demonstrates a problem.

    We've spent a lot of time speculating based on isolated snippets and not uncovered anything - it's time to go to a minimal, ready-to-run test case if we're going to look further.

    Comment


      #17
      Naroved problem to:
      Code:
      getManager().getMessageGrid().fetchData(ac,new DSCallback() {
      			
      			@Override
      			public void execute(DSResponse response, Object data, DSRequest dsRequest) {
      				try {			
      					final ResultSet resultset = new ResultSet();
      					resultset.setDataSource(getManager().getMessageGrid().getDataSource());		
      					resultset.setCriteria(ac);
      			
      					resultset.setInitialLength(response.getTotalRows());
      					resultset.setUseClientFiltering(false);
      					resultset.setUseClientSorting(false);
      when not setting
      Code:
      resultset.setCriteria(ac);
      the next fetch is Where "1" = "1"

      but when setting the criteria, the next fetch dosent call the execute() in DSCallback on this gird ?!? And I'm loading data to the grid in a Timer waiting for the DB table to populate with data to a certain point.

      Comment


        #18
        It's good you're making progress, but just for completeness, we won't be looking at this thread again until there is minimal, runnable code that clearly suggests a framework issue.

        Comment


          #19
          First off all, even if there is no framwork issue I expect ongoing help in the matter of framework usage. Support dose not mean that I help you find bugs and wait for relaese with fix.
          Secondly, no problem, although my provided code was more then enought for an runnable example:
          Code:
          		final ListGrid listgrid = new ListGrid();
          		listgrid.setAllowFilterExpressions(true);
          		listgrid.setDataFetchMode(FetchMode.PAGED);
          		listgrid.setDataPageSize(500);
          		//setProgressiveLoading(true);		
          		listgrid.setFilterOnKeypress(true);
          		//setShowRowNumbers(true);
          		listgrid.setAllowFilterExpressions(true);
          		
          		DataSource ds = DataSource.get("messages");// works with any DS, also supplyItem
          		listgrid.setDataSource(ds);
          		
          		final DSRequest request = new DSRequest();		
          		request.setSortBy(listgrid.getSort());
          		final AdvancedCriteria ac = new AdvancedCriteria(OperatorId.AND);
          		ac.addCriteria(new Criterion(MessageInterface._querryID, OperatorId.EQUALS, 1l));			
          		if(listgrid.getCriteria() != null){			
          			ac.addCriteria(listgrid.getFilterEditorCriteria());
          		}     		
          		Timer tim = new Timer() {
          			
          			@Override
          			public void run() {
          				listgrid.fetchData(ac,new DSCallback() {
          					
          					@Override
          					public void execute(DSResponse response, Object data, DSRequest dsRequest) {
          									
          							final ResultSet resultset = new ResultSet();
          							resultset.setDataSource(listgrid.getDataSource());		
          							resultset.setCriteria(ac);
          							resultset.setFetchMode(FetchMode.PAGED);
          							resultset.setInitialLength(response.getTotalRows());
          							resultset.setUseClientFiltering(false);
          							resultset.setUseClientSorting(false);
          
          							Record[] responseData = response.getData();
          							Record[] initialData = new Record[response.getEndRow()+1];
          							for (int i = 0; i < response.getEndRow(); i++) {
          							    if (i < response.getStartRow()) initialData[i] = null;
          							    else initialData[i] = responseData[i-response.getStartRow()];
          							}
          							resultset.setInitialData(initialData);
          							listgrid.setData(resultset);								
          							listgrid.setShowFilterEditor(true);
          											
          					       }		
          				},request);
          			}
          		};
          		tim.scheduleRepeating(20000);
          Issue:
          If resultset.setCriteria(ac); is not set then the next fetch will be with Where "1" = "1" if is set then the next fetch will not call execute()

          PS: sometimes I allso get an classCastExpt
          Code:
          java.lang.ClassCastException: org.apache.commons.collections.map.LinkedMap cannot be cast to java.lang.String
          	at com.isomorphic.datasource.DSRequest.getOperation(DSRequest.java:846)
          	at com.isomorphic.datasource.DSRequest.<init>(DSRequest.java:466)
          	at com.isomorphic.datasource.DSRequest.<init>(DSRequest.java:657)
          	at com.isomorphic.rpc.RPCManager.parseRequest(RPCManager.java:2198)
          	at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:309)
          	at com.isomorphic.rpc.RPCManager.<init>(RPCManager.java:289)
          	at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:132)
          	at com.isomorphic.servlet.IDACall.doPost(IDACall.java:73)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
          	at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152)
          	at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
          	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
          	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
          	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
          	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
          	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
          	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
          	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
          	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
          	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
          	at org.mortbay.jetty.Server.handle(Server.java:324)
          	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
          	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
          	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
          	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
          	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
          	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
          	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

          Comment


            #20
            There is no reason to call listGrid.fetchData() if you are going to replace the automatically created ResultSet immediately with your own - just call DataSource.fetchData() instead.

            And aside from not compiling, your code doesn't reproduce an error if we guess at the omitted details and run it in a standard environment.

            For your reference, the formal definition of support is that we do not look at a given issue until you've provided sufficient information to reproduce the problem. This is by necessity, since Support is an unlimited service; if you want someone to just troubleshoot your code, regardless of whether it shows a framework issue, we do offer that service, on an hourly basis: Consulting.

            As a matter of policy, we do typically try to speculate as to causes when a customer posts incomplete information, and we answer how-to questions. But this isn't a how-to question, and it's yet another piece of code that doesn't compile and has basic issues, with the basic required information (server logs, Developer Console logs, RPC tab information, etc) omitted yet again.

            When there's a pattern of this, we fall back on insisting on actual runnable code demonstrating a bug.

            We can provide immediate, very effective help - but only when you make it possible to do so.

            Comment


              #21
              I tried the above solution with ResultSets, because I need a possibility to progressive load additional records in to the grid without the "Loading" indicator after fetch. I would like to grow the data set in the grid without any information in the grid to the user in the background, plus the user must be able to work freely on the already provided data set, and only be informed that the DB table finished growing.

              Comment


                #22
                Using setData() with a ResultSet makes sense. Having the ListGrid automatically create a ResultSet for you and then immediately replacing it with another doesn't. That's why you should call DataSource.fetchData(), not ListGrid.fetchData().

                But again, this code isn't helping us reproduce an issue even with the bad usage.

                Comment


                  #23
                  Putting the problems, aside. Maybe the new aproach will help.
                  So:
                  1) I'm calling fetchData() on the ListGrid to create the initial result set.
                  2)Afterward I call in a cycle the DataSource.fetchData() to fetch the new data.

                  How do i provide the data from the DS fetches to the ListGrid without the reloading of the entire DataSet for the user and keeping the initial settings from the first fetch ?

                  Comment


                    #24
                    This seems a strange question, since you are already using the analogous technique when creating the ResultSet in your existing code - calling getCriteria(), etc.

                    Regardless, here again is that wiki article about background refresh, which shows code for this.

                    Comment


                      #25
                      Without setting the previous criteria of the grid in the result set
                      Code:
                      ResultSet resultSet = new ResultSet(dataSource);
                                  resultSet.setInitialLength(response.getTotalRows());
                                  resultSet.setInitialData(response.getData());
                                  resultSet.setInitialSort(listGrid.getSort());
                      resultSet.setCriteria(listgrid.getCriteria());
                      the next fetch will be without any criteria cause the next listGrid.getCriteria() will return an empty value map. Like you said, the resultSet overides.

                      Comment


                        #26
                        That's correct, criteria does need to be set on a hand-created ResultSet like yours. We'll update the code in the wiki article.

                        Comment


                          #27
                          It's hard to reproduce but it happens that, if U set the criteria in the new resultSet (otherwise seems to be working fine) and the first batch of data is smaller then the paging size, the next fetch on the DS doesn't call the execute() methode. I know that it's hard for you to reproduce problems on description, but the problem actually only appears when this given condition has place, so it depends on the DB size.

                          Comment


                            #28
                            That's an interesting hint, but unfortunately, does not give us something we can investigate on your behalf.

                            Just for your reference, there are 1000s of automated tests covering various aspects of this system. So if there's a framework bug here, it's going to be something obscure and unusual, which means it doesn't make sense for us to jump in and try random things in hopes of tripping across a bug.

                            Comment

                            Working...
                            X