3 Replies Latest reply on Feb 19, 2009 12:10 PM by Aleksandr Dubovsky

    a4j:mediaOutput and pdf

    Ben Zepp Newbie

      Hello

      We are currently using the a4j:mediaOutput to render dynamic generated pdf-Files. Unfortunately IE6 won't display the Object-Tag correctly if there is no type-Attribute (in our case: application/pdf).

      More Unfortunately is, that a4j:mediaOutput does not render the mimeType-Attribute in the html-response. Furthermore other Attributes like standBy or classId won't show up in the resulting html.

      A workaround (for IE6) is to use Javascript:

      <a4j:form id="docForm">
       <a4j:mediaOutput
       id="pdfOut"
       name="pdfOut"
       uriAttribute="data"
       element="object"
       width="100%"
       height="100%"
       createContent="#{documentController.renderPdf}"
       mimeType="application/pdf"
       standBy="loading..."/>
       </a4j:form>
       <script type="text/javascript">
      document.getElementById("docForm:pdfOut").type="application/pdf";
       </script>
      


      Note, that this code will also work in FF3 without using the javascript-hack, since FF3 is not that picky about mimeTypes like IE is.

      Library-versions: rich-faces-3.3.0 and myfaces-1.2.6

      I suggest to open a bugreport because mediaOutput doesnot render some Attributes

      tnx & greetings
      Ben