3 Replies Latest reply on Feb 11, 2011 9:15 AM by philippeaubertin

    Bug Excel Exporter with DataModel

    philippeaubertin

      Hi,
      I try to use excel exporter but I got an issue:



      Caused by java.lang.UnsupportedOperationException with message ""
      org.richfaces.model.ExtendedTableDataModel.getWrappedData(ExtendedTableDataModel.java:225)
      org.jboss.seam.excel.ui.UIWorksheet.unwrapIterator(UIWorksheet.java:556)
      
      ...
      



      When I look in the ExtendedTableDataModel source code , I found:



      Unused rudiment from old JSF staff. (non-Javadoc)
      
      See also:
          javax.faces.model.DataModel.getWrappedData()
      
      public Object  [Search] getWrappedData() {
           throw new UnsupportedOperationException();
      }



      So I checked the UIWorksheet source code and I found:




         @SuppressWarnings("unchecked")
         public static Iterator unwrapIterator(Object value)
         {
          ...
            else if (value instanceof DataModel && ((DataModel) value).getWrappedData() instanceof Iterable)
            {
               return ((Iterable) ((DataModel) value).getWrappedData()).iterator();
            }
          ....
         }



      Indeed I use a DataModel in order to populate my ExtendedDataTable.


      It's not possible to export a datatable populated with a datamodel, is it?


      Thanks,
      Best regards.


      Aubertin Philippe