Messages posted by leonbnu
[Logo]
ICEsoft.org Forums: ICEfaces, ICEmobile, ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icesoft.org  [Login] Login 
Messages posted by: leonbnu  XML
Profile for leonbnu -> Messages posted by leonbnu [16] Go to Page: 1, 2 Next 
Author Message

judy.guglielmin wrote:
I'm not sure that faces messages would be the correct way to do this as they are only event-scoped. (each push to the progress monitor is an event). Are you using the properties on the progress monitor for this (label and labelComplete)?
Once it is finished (or there is an exception or error), you could then queue the faces messages (is this what you are referring to having problems with?) 


Say I have a long running process processing a 50-page doc, I used the label property to display which page it's currently at like currentpage/totalpages. and I also have a <ice:message> beside the progressbar to show a summary(or error) information after done with each page. I've got this close to working now.

Yeah, I realized that seam's facesMessages component is only event scoped. I'm using with the JSF API to queue the message.
Hi, i'm new to Icefaces.
I need to add a facesMessage for a specific icefaces component programmatically. But I'm not sure how to do it cause the jsf api needs a clientId.

Thanks for your help!

Hi,
I was actually experimenting a similar case. I launched a long running business process using @Asynchronous method, then inside this business method, I actually didn't push the progress to outputprogress directly(although you could). Instead, to make it more fun, I raised an asynchronous event inside the long running process to notify an observer to update the view. It worked.

So yes, you can use @Asynchronous method to do this. But the ugly part is that you need to pass all the necessary objects around.


The only problem I'm trying to figure out now is how to display FacesMessages for the outputprogress component. This is for notifying the long running process status to the user.
When I play around with the progress bar in the component showcase today, some pushes are lost. The progress bar jumps randomly, which is supposed to progress 10% each time.
Yes, the showcase works. The file data is saved properly. Now I have to find out what's wrong with my code.

judy.guglielmin wrote:
Did you deploy seam-comp-showcase and see whether the file is uploaded to your server with it? (which application server?) 


no, but I will give it a try. I'm using Jboss AS 5.1

thanks,

judy.guglielmin wrote:
When you are stating that your file was not "saved", did you actually check the server location that you have designated/specified for the upload area? (from web.xml). Or are you simply referring to a listing you may have on your facelets page? (which might just be a result of the last "push" after the file is uploaded not occuring and you would set submitOnUpload="postUpload" for).

In your backing bean, you could always put an "else" statement to see what the status of the inputFile is. (if it's not SAVED).

 


Sorry for the confusion. I meant that the file data is not retained on the disk. I specified "/upload/" as the directory in the web.xml. but somehow the directory is always empty. And the status inputFile gives to me is SAVED.

My facelets page is rather simple, no attempt to display the list of the uploaded files.

thanks
my testing case is almost the same as the example in icefaces-seam-component show case. But somehow the file did not get saved on the disk. I logged the absolute directory path of the file saved. I'm using Icefaces 1.8.1 and seam 2.1.2.

Here is my code.

testinputfile.xhtml
Code:
 <ice:form>
 	<ice:inputFile actionListener="#{inputFileController.uploadFile}" 
    									progressListener="#{inputFileController.fileuploadProgress}" 
    									uploadDirectoryAbsolute="false"
    									submitOnUpload="none" />
     <ice:outputProgress  value="#{inputFileController.progress}" ></ice:outputProgress>
    					
 </ice:form>
 


InputFileController:
Code:
 @Name("inputFileController")
 @Scope(ScopeType.SESSION)
 public class InputFileController implements Serializable{
 	
 	@Logger private Log log;
 	
 	
 	
 	// File sizes used to generate formatted label
     public static final long MEGABYTE_LENGTH_BYTES = 1048000l;
     public static final long KILOBYTE_LENGTH_BYTES = 1024l;
     
    
     // files associated with the current user
     
     private final List<InputFileData> fileList =
             Collections.synchronizedList(new ArrayList<InputFileData>());
     // latest file uploaded by client
     private InputFileData currentFile;
 	
     
     private String parentDirectory="";
     
     private int progress;
     
     public void uploadFile(ActionEvent event){
     	InputFile inputFile= (InputFile)event.getSource();
     	log.info("uploadFile has been called. Status: "+inputFile.getFileInfo().getStatus());
     	
     	
     	if(inputFile.getFileInfo().getStatus()==inputFile.SAVED){
     		
     		if(this.parentDirectory.equals("")){
     			this.parentDirectory = inputFile.getFile().getParent();
     		}
     		log.info("the absolute path of the uploaded file is " + inputFile.getFile().getAbsolutePath());
     		InputFileData currentFile =  new InputFileData(inputFile.getFileInfo());
         	
         	
         	synchronized (fileList) {
             	if (!listContains(currentFile.getFile().getName())){
             		//only add the file to the list if it isn't already there
             		//fileupload will just update a more recent version of the file
                     fileList.add(currentFile);
             	}
             }
     		
     	}
     	
     	
     		
     	
     }
 
 public void fileuploadProgress(EventObject event){
     	InputFile ifile = (InputFile) event.getSource();
         progress = ifile.getFileInfo().getPercent();
     	
     } 
 
 @BypassInterceptors
     public int getProgress(){
     	return progress;
     	
     }
 }


and no exception popped up. The progress bar works, just the file is not there.
I've seen the exact same error but with Push Server + Jboss AS5.1. But it doesn't seem to stop my web application from working tho.

I also took a look at the component-showcase page on icefaces.org, same error happens.
My observation is that this seems to happen when the browser trying to parse the response of /block/receive-updated-views.
never mind. Turns out it has to be wrapped in a form.
I'm trying out the blinddown effect example on the Tutorial page(http://facestutorials.icefaces.org/tutorial/effects-tutorial.html), but it throws this exception on the icefaces-d2d.js javascript file when I click the button to fire the effects. I'm using icefaces 1.8.1 with facelets.

Thanks,
It's basically just a panel with a header, but I didn't find it in the doc. Although I guess I could create one manually, but still a ready-to-use one would be nice.

Thanks,
The document only talks about Jboss AS 4. But Jboss AS 5 uses it's own Jboss Web server.
Any example of how to configure the push server on Jboss 5?

Thanks!
There is an example in the source code package.
never mind, found it.
 
Profile for leonbnu -> Messages posted by leonbnu [16] Go to Page: 1, 2 Next 
Go to:   
Powered by JForum 2.1.7ice © JForum Team