1 Reply Latest reply on Mar 10, 2009 11:52 PM by Nicklas Karlsson

    Seam excel : "A worksheet's value must be an Iterable, DataModel or Query"

    Bob Mauranne Newbie
      Hi,

      I would like to export a rich:datatable to an Excel file like in the seam-excel example but i keep getting
      "org.jboss.seam.excel.ExcelWorkbookException: A worksheet's value must be an Iterable, DataModel or Query"


      Here's the service feeding the datatable
      `@Stateful
      @Scope(ScopeType.SESSION)
      @Name("previsionHydroServiceBS")
      public class PrevisionHydroServiceBO implements PrevisionHydroServiceBS {

           @EJB
           private PrevisionHydroDAS previsionHydroDAS;

           @DataModel
           private Map<String, String> previsions;

      // blabla

      @Factory("previsions")
      public void populatePrevisionList() {
      // ...
      }`



      my datatable
      `<r:dataTable id="table_previsions" value="#{previsions}" var="prev" rows="48">
        <r:column>
         <f:facet name="header">
          <h:outputText value="Tranche Horaire" />
         </f:facet>
         <h:outputText value="#{prev.key}" />
        </r:column>
        <r:column>
         <f:facet name="header">
           <h:outputText value="Prévision KW" />
         </f:facet>
         <h:outputText value="#{prev.value}" />
        </r:column>
      </r:dataTable>`

      the command button
      `<h:commandButton action="#{excelExporter.export('table_previsions')}" />`
      My button is in a <form> scope but not my datatable, but that's not the cause of the problem i think.


      The exception says that i need to feed the seam excel with a datamodel, but my map is tagged @datamodel, so that's not so helpful.


      I am relatively new at web developpement, so the problem might be any dumb mistake, and i am sorry if it is.

      If someone could help me, i'd be grateful.

      Thanks

      ps : sorry, it seems that the markups are not working