3 Replies Latest reply on Sep 24, 2013 6:06 PM by Brian Leathem

    Richfaces 4.2.3 ExtendedDataModel walk method

    Maris K Newbie

      Trying to make use of ExtendedDataModel for rich:extendedDataTable and develop data lazy loading.

       

      Problem encountered is that Range passed to walk method always has getFirstRow() = 0. Number of rows returned is fine. Does anyone has a clue how to solve this?

       

      Walk looks like this:

          public void walk(FacesContext context, DataVisitor visitor, Range range, Object argument) {
              log.debug("Walking through dataset...");
                    
              if (this.documentType != null) {
                Map<String, String> dataFilter = this.createFilterCriteria();
                Map<String, Boolean> dataOrder = this.createOrders();
                      
                int docStart = 0;
                int docCount = 0;
      
                SequenceRange sequenceRange = (SequenceRange) range;
              
                log.debug("DataSet walk rangeStart = " + sequenceRange.getFirstRow());
              
                if (sequenceRange.getFirstRow() >= 0 && sequenceRange.getRows() > 0) {
                    docStart = sequenceRange.getFirstRow();
                    docCount = sequenceRange.getRows();
                }
              
                log.debug("Starting doc number = " + docStart + "; docCount = " + docCount);
        
                data = this.transformData(listParser.getDocumentList(dataFilter, dataOrder, docStart, docCount));
                for (Map<String, String> t : data) {
                    visitor.process(context, getId(t), argument);
                }
              }
        
           }
      
      

       

      listParser is EJB that returns list of documents which are transformed within data model for display. data is list of Map<String, String>.

       

      Method getRowCount() calls the same EJB and returns correct number of records.

       

      Development is being done using Jboss EAP 6.1.0.Final