1 Reply Latest reply on Jun 4, 2009 4:56 PM by Nick Belaevski

    How to override visitor.process

    ZJ DA Newbie

      Hi, I have a class extending ExtendedDataModel for pagination of DataTable. Based on the richfaces demo, I need code in the walk method like:

       for (ObjectBean item: cachedItems) {
       visitor.process(facesContext, item.getObjectID(), argument);
       }
      


      However, some properties in ObjectBean displayed in the columns of DataTable are not simple String properties. For example, ObjectBean has a list which contains a subset of predefined properties and needed to be displayed as columns. Is it possible to override visitor.process to provide my own data values for the table rows?

      Thanks,
      -ZJ

        • 1. Re: How to override visitor.process
          Nick Belaevski Master

          Hi ZJ,

          Walk method only generates keys, real data is requested using getRowData() method. Here is the sequence:

          1. Model walks data generating keys and passes keys to Visitor provided by component.
          2. Visitor calls setRowKey() at component
          3. Component calls model's setRowKey()
          4. If model's isRowAvailable() method returns true, component reads row data by calling model's getRowData() method.