Usage:
either:
function uploadFiles() {
RemoteClass.uploadFiles(dwr.util.getValue("file1"), dwr.util.getValue("file2"), { fileProgress: true });
}
or:
function uploadFiles() {
dwr.engine.setFileProgress(true);
RemoteClass.uploadFiles(dwr.util.getValue("file1"), dwr.util.getValue("file2"));
}
Changes Required:
1. client: Display the progress bar using logic similar to useLoadingImage() described here
http://getahead.org/dwr/browser/util/useloadingmessage
2. server: Change org.directwebremoting.dwrp.ParseUtil to sends the status back to the browser using reverse ajax for each file being uploaded.
3. client: Use the status to update the progress bar.
Suggestied Solution:
1. Three new functions required in engine.js:
showFileProgressBars(): hides file inputs and displays progress bars in their place, gives each progress bar an id
updateFileProgressBar(id, percentage): updates a status bar with the upload percentage
hideFileProgressBars(): display the file inputs in place of the progress bars
2. org.directwebremoting.dwrp.ParseUtil should set a progress listener on SERVLET_FILE_UPLOAD.