2 Replies Latest reply on Mar 29, 2012 4:54 AM by anis jaballah

    walk method called manytimes for the first time

    anis jaballah Newbie

      Hi,

       

      I extended ExtendedDataModel in order to face to the problem of the lazy pagination, but I am having this problem : I am loding the data inside the method walk, and for the first time when I click on search the walk method is called 3 times, but after that it is called just once:

      this is the method walk

       

      @Override
          public void walk(FacesContext fc, DataVisitor dv, Range range, Object o) {
              SequenceRange sr = (SequenceRange) range;
              int firstRow = sr.getFirstRow();
              int numbersRows = sr.getRows();
              Manager manager = new Manager();
             data = manager.loaddata();
              for (Declaration dec : data) {
                        try {
                                  wrappedData.put(dec.getId(), dec);
                                              dv.process(fc,dec.getId(), o);
                                    } catch (IOException e) {
                                              e.printStackTrace();
                                    }
                          }
          }
      
      

      and this is the method getRowData :

       

       @Override
          public Declaration getRowData() {
      
              //return data.get(rowKey);
                    return wrappedData.get(rowKey);
          }
      
      

      Thanks in advance