Reputation: 5236
I have a graphicImage component but I couldn't see my loading.gif file. I think there is a problem with file path. My image is under "Web Pages/Resources/images/loading.gif".
I am using Netbeans and Here is my page "Web Pages/Pages/customPages/index.xhtml";
<p:blockUI block="myDataTable" trigger="myDataTable">
Loading<br />
<p:graphicImage library="images" value="loading.gif"/>
</p:blockUI
EDIT: These are also didn't work :)
library="images" value="loading.gif"
library="resources/images" value="loading.gif"
value="loading.gif"
library="resources" value="loading.gif"
EDIT2: Here is how I solved this issue but I don't think it is a good solution. Is there any other way?
value="#{FacesContext.getCurrentInstance().getExternalContext()}/resources/images/loading.gif"
Upvotes: 6
Views: 23475
Reputation: 11
use the attributte library to indicate the folder that is inside the resources folder
<p:graphicImage library="images" name="loading.gif" />
if you use subfolders
<p:graphicImage library="images" name="folder1/folder2/loading.gif" />
Upvotes: 1
Reputation: 1731
When you use library
attributte you shouldn't use value
attributte. Use name
attributte instead. Try:
<p:graphicImage library="images" name="loading.gif" />
Upvotes: 16