0 Replies Latest reply on Jun 21, 2011 8:57 AM by gtludwig

    problem in accessing managed bean in JSF2 + Richfaces 4 project

    gtludwig

      public void listener(FileUploadEvent event) throws Exception {Hi all,

       

      I'm new to JSF2 + RichFaces 4, so I harvested infos and tips here and there on how to start the project. So far I've a very simple project, one xhtml page, with a <rich:dataTable /> and a <rich:fileUpload /> on a <rich:popupPanel />. The idea is to upload MS-Excel files into to the application, perform some logic and display an entry (generated from the MS-Excel file's content) on the <rich:dataTable />.

       

      The <rich:fileUpload /> is defined like this:

       

      <rich:fileUpload id="popupFileUpload"

           title="Indique o caminho do arquivo a carregar"

           acceptedTypes="xls, xlsx" uploadData="#{assemblyMB.batchList}"

           fileUploadListener="#{assemblyMB.listener}"

           maxFilesQuantity="#{assemblyMB.uploadsAvailable}" listHeight="250"

           listWidth="400"

           onuploadcomplete="#{rich:component('popup')}.hide(); return false;"

           noDuplicate="true" />

       

      On the managed bean, I have the annotation @ManagedBean(name = "assemblyMB"), and the listener method now is very simple:

       

      public void listener(FileUploadEvent event) throws Exception {

           System.out.println("listener");

      }

       

      I intend to access the method on the managed bean when the file is uploaded, but I'm failing to do so. I don't understand why is that happening.

      Can anybody throw me a light here?

       

      Thanks in advance,

       

      gtludwig