Details
Description
A css file with the following:
@import url("printPreview.css") print;
Is generating a javascript error in Firefox:
NetworkError: 404 Not Found - http://localhost:8080/williamspoc/javax.faces.resource/printPreview.css"
The printPreview.css file is included as follows:
<h:outputStylesheet name="print.css" library="css" rendered="#{printPreviewBackingBean.printPreview}"/>
<h:outputStylesheet name="printPreview.css" library="css" rendered="#{printPreviewBackingBean.printPreview}"/>
The stylesheet is applied to the page, however, the javascript error shows up in the console. This can be reproduced in the poc.
@import url("printPreview.css") print;
Is generating a javascript error in Firefox:
NetworkError: 404 Not Found - http://localhost:8080/williamspoc/javax.faces.resource/printPreview.css"
The printPreview.css file is included as follows:
<h:outputStylesheet name="print.css" library="css" rendered="#{printPreviewBackingBean.printPreview}"/>
<h:outputStylesheet name="printPreview.css" library="css" rendered="#{printPreviewBackingBean.printPreview}"/>
The stylesheet is applied to the page, however, the javascript error shows up in the console. This can be reproduced in the poc.
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Upon further review, this was not the best technique, changed to the following:
<link href="#
{resource['css:print.css']}" rel="stylesheet" type="text/css" media="print"/>
{printPreviewBackingBean.printPreview}<h:outputStylesheet name="printPreview.css" library="css" rendered="#
"/>
The @import is not necessary because the printPreview.css file is already applied to the printPreview window. We just need the print.css applied to the actual printing, to remove a couple of buttons.