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

    Bug Excel Exporter with DataModel

    Philippe Aubertin Newbie

      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