I have a strange problem with the p:fileUpload
update of PrimeFaces. I upload an image and save it in a database and this is already working.
Here is my code for the p:fileUpload
.
<p:fileUpload fileUploadListener="#{playerController.handleFileUpload}"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
update="messagePanel preview" />
After the upload i render a h:panelGroup
which shows the image.
<h:panelGroup id="preview">
<p:graphicImage value="#{facesContext.externalContext.contextName}/showProfileImage?&preview=true" alt="#{playerController.selected.image.name}" />
<h:outputText value="#{playerController.selected.image.name}" />
</h:panelGroup>
In Google Chrome everything is working perfect but in Firefox and Internet Explorer the image does not render when I have already uploaded an image. The old image still appears. After refreshing the page the new image is there.
In FireBug I get this message: "NS_ERROR_NOT_IMPLEMENTED: Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMLSProgressEvent.input]"
I updated all my browsers to the newest version and I am using PrimeFaces 3.5.
There is an extra whitespace just before
&preview=truein your code. I am emphasizing it using * * * here:
<p:graphicImage value="#{facesContext.externalContext.contextName}/showProfileImage?*****&preview=true" alt="#{playerController.selected.image.name}"/>
Remove the whitespace and try it. May be FF and IE doesnt like the space and Chrome is linient
have you tried removing the template/css components you're using in your project? I have kind of the same problem, and I noticed that if i remove all those components it work fine.
User contributions licensed under CC BY-SA 3.0