voyent
[SOLVED] Messages added in inputFile's actionListener don't allways get rendered  XML
Forum Index -> Components
Author Message
edykory


Joined: 27/Nov/2006 00:00:00
Messages: 332
Offline


Hi there,

I have the following:
Code:
<ice:inputFile id="inputFile" actionListener="#{uploadController.fileUploaded}" 
 					progressListener="#{fileUploadProgressListener.progressMade}" progressRender="true" />


and

Code:
public void fileUploaded(ActionEvent event) {
 		InputFile inputFile = (InputFile) event.getSource();
 		if (inputFile.getStatus() == InputFile.SAVED) {
 			FileInfo fileInfo = inputFile.getFileInfo();
 			FacesUtils.info("File uploaded");
 			log.info("I uploaded " + fileInfo.getFileName());
 		}		
 	}


Where the FacesUtils.info does this
Code:
public static final void info(String summary) {
 		getFacesContext().addMessage(null,
 				new FacesMessage(FacesMessage.SEVERITY_INFO, summary, null));
 	}

My problem is that the messages don't get displayed each time I upload a file. Only seldom. Any ideas?

Eduard
edykory


Joined: 27/Nov/2006 00:00:00
Messages: 332
Offline


Mda ... solved it. Pretty stupid of me.

I used the progressRender="true" stuff since I use a progressbar and because of this I hadn't declared my controller as Renderable anymore. I made it Renderable and now the messages are shown correctly. (Should have been pretty straight forward, considering upload takes place asynchronously).

Eduard
 
Forum Index -> Components
Go to:   
Powered by JForum 2.1.7ice © JForum Team