1

I am working with JSF2.0 – myfaces implementation. Our target runtime environment is WAS8.5. We are loading CSS using h:outputStylesheet

I want to print part of my page content in one of my page. To do that overriding css media attribute with media=”screen,print” OR media=”all”.

Unfortunately, media attribute is not supported in JSF2.0 myfaces implementation (https://myfaces.apache.org/core20/myfaces-impl/tagdoc/h_outputStylesheet.html).

There are no option to change JSF library.

I have read this before posting

Conditionally render JSF components for printing

I have searched in some libs like Omnifaces but none.

Do I have to create a cutom tag ?

(I think this is the righ direction jsf 2.0 Custom Component/Tag NOT COMPOSITE and I'll take a look at http://www.mastertheboss.com/javaee/jsf/jsf-java-based-custom-tags-example?showall=)

or is better to modify CSS

    @media print {
        #header, #footer, #menu { 
            display: none;
        }
    }

Thanks

Community
  • 1
  • 1
user1594895
  • 587
  • 1
  • 10
  • 31
  • It was only added in JSF 2.1. Do you see chance to upgrade MyFaces to a 2.1.x version? JSF 2.1 is 100% compatible on an existing JSF 2.0 targeted project without any code and configuration changes. – BalusC Jan 08 '16 at 22:41
  • @BalusC thanks. No, sorry the production enviorment is not under our control target is base WAS 8.5. Sorry. Have you any suggestion for the right way to follow? – user1594895 Jan 09 '16 at 08:54
  • Use plain HTML ``. – BalusC Jan 09 '16 at 09:30

0 Answers0