3 Replies Latest reply on Mar 23, 2007 10:42 AM by ilya_shaikovsky

    search solution for show a file pdf

    liuliu


      hi everyone,

      I use a iframe to show a pdf file . now i want to use ajax to refresh this iframe to change the pdf file. it does not work to refresh directly like other component. neither with a4j:include .

      any suggestion?

      thanks



        • 1. Re: search solution for show a file pdf

          iframe is not a component. So, of you wrap up it with JSF component, and point to this wrapper component with reRender, it should work.

          Actually, you can update the content of iframe by changing the 'src' attribute of this iframe from javascript. No additional ajax functionality like for a4j:include is required in this case.

          • 2. Re: search solution for show a file pdf
            liuliu

            hi,

            thanks for your quick response. You are right. i wrapped iframe with a4j:outputpanel, and it works.

            i use also rich:tabpanel in my program. but there is a strange problem, the iframe is not refreshed when the switchmode is client. the switchmode of tab with iframe must be ajax or server.

            here is a simple code.

             <rich:tabPanel switchType="client" height="100%">
             <rich:tab label="Document" >
             <a4j:outputPanel id="resulta">
             <iframe frameborder="0" width="99%" height="100%" src="../a.pdf"
             style="border-left:1px solid #BDBABD" />
             </a4j:outputPanel>
             </rich:tab>
             <rich:tab label="tab2">
             tab 2
             </rich:tab>
             <rich:tab label="tab3">
             tab 3
             </rich:tab>
             </rich:tabPanel>
            


            • 3. Re: search solution for show a file pdf
              ilya_shaikovsky

              In client mode - there is no submits to server.. this is just switching via client JS - so nothing except the tabPanel updated.