2 Replies Latest reply on Feb 8, 2010 5:43 AM by jsf geeks

    Print content of panelGroup

    jsf geeks Master

      Hi all,


              This is somwhat different. I have a page with panelGroup and a button (outside the panelGroup). What I want is, if user clicks on the button, it should print the content of panelGroup. I don't know whether is it is possible or not. Please point out some ways to do it.


      Thank you in advance,


        • 1. Re: Print content of panelGroup
          Nick Belaevski Master



          Yes, it's possible.


          1) Add CSS classes for "print" media that will hide unnecessary content

          2) Invoke window.print() by button click

          • 2. Re: Print content of panelGroup
            jsf geeks Master

            Hi Nick,


                Thanks for your support. I done it by your alternative. I took following 2 CSS,


            <style type="text/css" media="aural"><!--
                            body { color: white; font-size: 13px; font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: black }
                            a { color: #ffa500 }
                            table#main { width: 750px }
                            .noScreen {display:none}-->

                        <style type="text/css" media="print"><!--
                            table#main { width: 550px }
                            body { color: black; font-family: Arial, Georgia, Times; background-color: white; font-size:13px; }
                            .noScreen {display:normal }
                            a {display:none}


                And in my button, I took styleClass="noPrint". It works perfect as I need.


            Thanks again,

            JSF GEEKS