Hi All,
Just joined and it's my first post so I think congratulations on marvelous work for Primefaces team are due.
I'm running JSF2 with Mojarra on Tomcat 7.0.11 and Primefaces 3.0.M1. Everything works smoothly apart from when I'm using FileUpload. The upload works all right all the way through, no problem's here. But the Growl messages never come up. I've testes on Primefaces 2.2.1 as well and get the same thing. Elsewhere Growl messages are working just fine but for some reason they won't with FileUpload component. I've checked if all resources are loaded correctly and if everything is in place (css, js etc ) .
If someone had encountered this problem before I'd appreciate any help.
Many Thanks,
Fissk
Growl not working with FileUpload
Hi robert.m,
Thanks for your prompt reply.
I am using pretty much exactly same code as one given on the showcase site
If i set growl to autoUpdate still nothing.
Thanks for your prompt reply.
I am using pretty much exactly same code as one given on the showcase site
Code: Select all
<h:form enctype="multipart/form-data" prependId="false">
<p:growl id="uploadStatus" showDetail="true"/>
<p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"
mode="advanced"
update="uploadStatus"
multiple="true"
sizeLimit="2000000"
allowTypes="png,gif,jpg"/>
</h:form>
Tomcat 7.0.19 Mojarra 2.1.2, Primefaces 3.0M2
Code: Select all
import java.io.Serializable;
import javax.inject.Named;
import javax.enterprise.context.RequestScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import org.primefaces.event.FileUploadEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author fissk
*/
@Named(value = "fileUploadController")
@RequestScoped
public class FileUploadController implements Serializable
{
private Logger logger = LoggerFactory.getLogger(FileUploadController.class);
/** Creates a new instance of FileUploadController */
public FileUploadController()
{
}
public Logger getLogger() {
return logger;
}
public void setLogger(Logger logger)
{
this.logger = logger;
}
public UploadedFile getUploadedFile()
{
return uploadedFile;
}
public void setUploadedFile(UploadedFile uploadedFile)
{
this.uploadedFile = uploadedFile;
}
public void handleFileUpload(FileUploadEvent event)
{
logger.info("Uploaded: {}", event.getFile().getFileName());
FacesContext context = FacesContext.getCurrentInstance();
context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, event.getFile().getFileName(), " uploaded successfully."));
}
}
Again this is just to test if the upload module is functioning, without the actual file handling code. It works fine and what's more it works with p:message or p:messages but never with growl. Any ideas?
Tomcat 7.0.19 Mojarra 2.1.2, Primefaces 3.0M2
-
- Posts: 13
- Joined: 20 Dec 2011, 22:52
Was this issue ever resolved?
There are instances in the showcase it self where growl does not work properly.
DataTable complex being one.
There are instances in the showcase it self where growl does not work properly.
DataTable complex being one.
IBM RBD - Eclipse - IBM WAS - Tomcat 7 - Primefaces 3.0 - JFS 2.1
-
- Posts: 6
- Joined: 19 Apr 2012, 15:32
Works with Primefaces 3.2.
With Primefaces 3.1.1, I needed to put the growl in its own form!
Bit of a gotcha: Users of Spring Roo will find version 3.1.1 of Primefaces being put into their POM when using "web jsf setup".
With Primefaces 3.1.1, I needed to put the growl in its own form!
Bit of a gotcha: Users of Spring Roo will find version 3.1.1 of Primefaces being put into their POM when using "web jsf setup".
-
- Information
-
Who is online
Users browsing this forum: No registered users and 50 guests