1 Reply Latest reply on Aug 1, 2011 9:57 PM by Brin Dun

    A problem about Passing data in EVENT scope with Seam excel

    Brin Dun Newbie
      Recently,I encountered a problem about passing data in EVENT scope with Seam excel.
      the exception is :A worksheet's value must be an Iterable, DataModel or Query.


      I have been tested successful when I changed the scope of the component  "paySuccessAction" to SESSION ; but it won't work in scope which below the seesion scope.

      the question is :How can I pass the data in Event Scope?

      1.the component file PaySuccessAction.java :
      `
      @Name("paySuccessAction")
      @Scope(ScopeType.PAGE)
      public class PaySuccessAction
      {
             @Out(required=false,scope=ScopeType.EVENT)
             private List<TPaymentRecord> records;
             
             public void getBatchList()
             {
                  records=paymentRecordBO.getInstancyList();
             }

             public List<TPaymentRecord> getRecords() {
                 return records;
             }


      }

      `

      2.the config file paySuccess.page.xml :
      `
      <?xml version="1.0" encoding="UTF-8"?>
      <page view-id="/module/payment/record/paymentSuccess.xhtml" xmlns="http://jboss.com/products/seam/pages"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd">
            <navigation from-action="#{paySuccessAction.getBatchList()}">
             <render view-id="/module/payment/record/batchExcelExport.xhtml"/>
            </navigation>
      </page>

      `

      3.the excel templete batchExcelExport.xhtml :
      `
      <e:workbook filename="batchExcelExport.xls"
      xmlns:e="http://jboss.com/products/seam/excel"
      xmlns:f="http://java.sun.com/jsf/core">
      <e:worksheet  startRow="2" value="#{records}" var="record">
      .....
      </e:worksheet>
      </e:workbook>

      `
        • 1. Re: A problem about Passing data in EVENT scope with Seam excel
          Brin Dun Newbie

          Brin Dun wrote on Aug 01, 2011 21:37:


          Recently,I encountered a problem about passing data in EVENT scope with Seam excel.
          the exception is :A worksheet's value must be an Iterable, DataModel or Query.


          I have been tested successful when I changed the scope of the component  paySuccessAction to SESSION ; but it won't work in scope which below the seesion scope.

          the question is :How can I pass the data in Event Scope?

          1.the component file PaySuccessAction.java :
          @Name("paySuccessAction")
          @Scope(ScopeType.PAGE)
          public class PaySuccessAction 
          {
                 @Out(required=false,scope=ScopeType.EVENT)
                 private List<TPaymentRecord> records;
                  
                 public void getBatchList() 
                 {
                      records=paymentRecordBO.getInstancyList(); 
                 }
           
                 public List<TPaymentRecord> getRecords() {
                     return records;
                 }
           
           
          }



          2.the config file paySuccess.page.xml :
          <?xml version="1.0" encoding="UTF-8"?>
          <page view-id="/module/payment/record/paymentSuccess.xhtml" xmlns="http://jboss.com/products/seam/pages"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd">
                <navigation from-action="#{paySuccessAction.getBatchList()}">
                 <render view-id="/module/payment/record/batchExcelExport.xhtml"/>
                </navigation>
           </page>



          3.the excel templete batchExcelExport.xhtml :
          <e:workbook filename="batchExcelExport.xls" 
          xmlns:e="http://jboss.com/products/seam/excel"
          xmlns:f="http://java.sun.com/jsf/core">
          <e:worksheet  startRow="2" value="#{records}" var="record">
          .....
          </e:worksheet>
          </e:workbook>




          Click HELP for text formatting instructions. Then edit this text and check the preview.