1 Reply Latest reply on Oct 1, 2009 3:40 AM by anisj1m

    the mediaOutput example and the value attribute

      Hi,

      in the example of http://anonsvn.jboss.org/repos/richfaces/branches/community/3.3.X/samples/mediaOutput
      the value property contain a name of file :

      <a4j:mediaOutput element="object" cacheable="false" session="true"
       value="rc044-010d-richfaces_3.pdf" createContent="#{bean.paint}"
       type="application/pdf">something</a4j:mediaOutput>
      



      public void paint(OutputStream out, Object data) throws IOException {
       if (data instanceof String) {
       InputStream file = FacesContext.getCurrentInstance()
       .getExternalContext().getResourceAsStream((String) data);
       int size = file.available();
       byte[] pdf = new byte[size];
       file.read(pdf);
       file.close();
       out.write(pdf);
       }
      


      in my application i want to pass a stream to the mediaOutput value because i am dynamically generating repport , is it possible ?

      thanks in advance,