0 Replies Latest reply on Sep 16, 2010 10:18 AM by Roger Lee

    a4j:mediaOutput calling EJB

    Roger Lee Apprentice

      I'm trying to use  a4j:mediaOutput, but instead of calling a POJO I am using an EJB (3).

       

      In the XHTML I need to call the method in my FileUploadBean (EJB);

      public void paint(OutputStream stream, Object object) throws IOException {

           stream.write(getFiles().get((Integer)object).getData());

      }

       

      What parameters do I pass from the XHTML? In the example it appears to pass the 'row' and I'm not sure where the outStream comes from?

       

      As it's a method in an EJB I need to pass the two; 1. Stream and the 2. the Data Object.

       

       

       

       

       

       

       

      <a4j:mediaOutput element="img" mimeType=

      "#{file.mime}"

       

       

      createContent="#{fileUploadBean.paint(row, XXXXX)}" value=

      "#{row}"

       

       

      style="width:100px; height:100px;" cacheable="false"

      >

       

       

      <f:param value="#{fileUploadBean.getTimeStamp()}" name="time"/>

       

       

      </a4j:mediaOutput

      >

       

      Any examples. Thanks