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"
When you use library
attributte you shouldn't use value
attributte. Use name
attributte instead. Try:
<p:graphicImage library="images" name="loading.gif" />
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With