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
Brad Kroeger
created issue -
Brad Kroeger
made changes -
Field | Original Value | New Value |
---|---|---|
Assignee | Ken Fyten [ ken.fyten ] |
Brad Kroeger
made changes -
Salesforce Case | [] | |
Priority | Major [ 3 ] | Minor [ 4 ] |
Brad Kroeger
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Fix Version/s | 2.1-Beta [ 10291 ] | |
Resolution | Invalid [ 6 ] |
Ken Fyten
made changes -
Salesforce Case | [] | |
Fix Version/s | 3.0 [ 10241 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
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.