[richfaces-issues] [JBoss JIRA] Resolved: (RF-4349) fileUpload problem - error message is not displayed and there's a abort fileUploadListener problem

Ilya Shaikovsky (JIRA) jira-events at lists.jboss.org
Fri Dec 5 04:20:36 EST 2008


     [ https://jira.jboss.org/jira/browse/RF-4349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilya Shaikovsky resolved RF-4349.
---------------------------------

    Resolution: Duplicate Issue


https://jira.jboss.org/jira/browse/RF-3566

> fileUpload problem - error message is not displayed and there's a abort fileUploadListener problem
> --------------------------------------------------------------------------------------------------
>
>                 Key: RF-4349
>                 URL: https://jira.jboss.org/jira/browse/RF-4349
>             Project: RichFaces
>          Issue Type: Feature Request
>    Affects Versions: 3.2.1
>         Environment: jsf, a4j
>            Reporter: Hrvoje Jo
>             Fix For: Future
>
>
> Hi!
> I would like to know is there a way to stop fileUploadListener (fileUpload component) and diplay error message?
> E.g.
> I would like to upload file only if file with sam name doesn't egsist on server. It would be nice if the validation would be on client side. So I tried to do validation inside of fileUploadListener, but the message (<rich:messages />) is not shown, although the upload is stopped, and message is added.
> Is this a bug, or am I doing something wrong? Here is the code 
> public void processUpload(UploadEvent event) {
> 				
> 		UploadItem item = event.getUploadItem();
> 		java.io.File f = item.getFile();
> 		
> 		fileList = getFiles();		
> 		for (File file : fileList) {
> 			if(item.getFileName().equals(file.getName())){
>                                FacesContext ctx = FacesContext.getCurrentInstance();
>                                 //Show message
> 		              ctx.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_ERROR, 
>                                              "error", "error"));
> 				
> 				ctx.renderResponse();
> 				return;
> 			}
> 		}
>                 //If file doesn't egsists...
> 		...	
> There is a post on forum
> http://www.jboss.com/index.html?module=bb&op=viewtopic&t=141559&start=0&postdays=postDays&postorder=postOrder&highlight=highlight

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list