media attribute is missing in MyFaces h:outputStylesheet

681 views Asked by At

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

0

There are 0 answers