Dynamic show PDF in lightbox

UI Components for JSF
Post Reply
ericmacau
Posts: 17
Joined: 09 Jun 2010, 06:22

27 May 2016, 10:42

Hello,

Is it possible to popup a lightbox (iframe) to show a PDF that is generated in the backing bean ?

Code: Select all


<p:lightbox iframe="true" width="800px" height="600px">


     <p:commandLink value="Click to show PDF" action="....{backing bean method to generate a PDF and put it in the application scope session}...."/>

</p:lightbox> 

From the above example, how can make it work for showing the generated pdf when click on the command button? Please teach me.

Thanks.

hsntpn
Posts: 15
Joined: 18 Mar 2016, 21:24

17 Jun 2016, 09:59

You can use lightBox feature if you want to dynamic pdf connect to java class bean and you must dynamicly send pdf link from bean and each event is required to update the page.

Code: Select all

 <p:lightBox iframe="true" id="lighbox3">
                <h:outputLink value="http://www.scala-lang.org/docu/files/ScalaByExample.pdf" title="PrimeFaces HomePage">
                    <h:outputText value="PrimeFaces HomePage" />
                </h:outputLink>
            </p:lightBox>
            
             <p:lightBox iframe="true" id="lighbox3">
                <h:outputLink value="....LOCAL PDF" title="pdf example">
                    <h:outputText value="-Your Pdf-" />
                </h:outputLink>
            </p:lightBox>

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests