Author: nbelaevski
Date: 2008-12-07 09:07:17 -0500 (Sun, 07 Dec 2008)
New Revision: 11616
Modified:
trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java
Log:
https://jira.jboss.org/jira/browse/RF-4992
Modified: trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java
===================================================================
--- trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java 2008-12-07
14:06:20 UTC (rev 11615)
+++ trunk/ui/fileUpload/src/main/java/org/richfaces/component/UIFileUpload.java 2008-12-07
14:07:17 UTC (rev 11616)
@@ -182,9 +182,10 @@
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();
Map<String, String> requestParameterMap =
externalContext.getRequestParameterMap();
- if ("progress".equals(requestParameterMap.get("action"))
- && requestParameterMap.containsKey(
- this.getClientId(facesContext))) {
+
+ String actionString = requestParameterMap.get("action");
+
+ if (actionString != null &&
requestParameterMap.containsKey(this.getClientId(facesContext))) {
AjaxContext ajaxContext =
AjaxContextImpl.getCurrentInstance(facesContext);
String uid = requestParameterMap.get(Filter.UPLOAD_FILES_ID);
@@ -195,8 +196,12 @@
if (sessions != null) {
MultipartRequest multipartRequest = sessions.get(uid);
if (multipartRequest != null) {
- setupProgressBarValueExpression(facesContext, uid);
- ajaxContext.setResponseData(multipartRequest.getSize());
+ if ("progress".equals(actionString)) {
+ setupProgressBarValueExpression(facesContext, uid);
+ ajaxContext.setResponseData(multipartRequest.getSize());
+ } else if
("richfaces_file_upload_action_stop".equals(actionString)) {
+ multipartRequest.stop();
+ }
}
}
}