Author: andrei_exadel
Date: 2008-02-19 09:43:42 -0500 (Tue, 19 Feb 2008)
New Revision: 6169
Removed:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/FileItem.java
Modified:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartRequest.java
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
file upload refactoring
Deleted:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/FileItem.java
===================================================================
---
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/FileItem.java 2008-02-19
14:41:47 UTC (rev 6168)
+++
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/FileItem.java 2008-02-19
14:43:42 UTC (rev 6169)
@@ -1,119 +0,0 @@
-/*
- * FileItem.java Date created: 03.01.2008
- * Last modified by: $Author$
- * $Revision$ $Date$
- */
-
-package org.richfaces.org.jboss.seam.ui.component;
-
-import java.io.Serializable;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Class provides an entity for file item in file upload list
- * @author "Andrey Markavtsov"
- *
- */
-public class FileItem implements Serializable{
-
- private static final long serialVersionUID = 42L;
-
- /** Defines list of statuses available */
- public static enum Status {ADDED, MARKED_4_UPLOAD, IN_PROGRESS, UPLOADED,
CANCELLED};
-
- /** Pattern to search file name in full file name string */
- private static final Pattern pattern = Pattern.compile
- (".*\\\\+(.*)");
-
- /** Current status */
- private Status status;
-
- /** File name */
- private String fileName;
-
- /** File size */
- private Integer fileSize;
-
-
- /**
- * TODO Description goes here.
- */
- public FileItem() {
- super();
- // TODO Auto-generated constructor stub
- }
-
-
-
- /**
- * TODO Description goes here.
- * @param fileName
- */
- public FileItem(String fileName) {
- super();
- this.fileName = fileName;
- this.status = Status.ADDED;
- }
-
- /**
- * @return the fileName
- */
- public String getFileName() {
- Matcher matcher = pattern.matcher(fileName);
- if (matcher.matches()) {
- return matcher.group(1);
- }
- return fileName;
- }
-
- /**
- * @return the fileName
- */
- public String getFullFileName() {
- return fileName;
- }
-
-
- /**
- * @param fileName the fileName to set
- */
- public void setFileName(String fileName) {
- this.fileName = fileName;
- }
-
- /**
- * @return the fileSize
- */
- public Integer getFileSize() {
- return (Integer)fileSize/1000;
- }
-
- /**
- * @param fileSize the fileSize to set
- */
- public void setFileSize(Integer fileSize) {
- this.fileSize = fileSize;
- }
-
-
-
- /**
- * @return the status
- */
- public Status getStatus() {
- return status;
- }
-
-
-
- /**
- * @param status the status to set
- */
- public void setStatus(Status status) {
- this.status = status;
- }
-
-
-
-}
Modified:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java
===================================================================
---
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java 2008-02-19
14:41:47 UTC (rev 6168)
+++
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/component/UIFileUpload.java 2008-02-19
14:43:42 UTC (rev 6169)
@@ -1,35 +1,15 @@
package org.richfaces.org.jboss.seam.ui.component;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.el.ValueExpression;
-import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
-import javax.faces.context.FacesContext;
-import org.richfaces.component.UIProgressBar;
-import org.richfaces.org.jboss.seam.ui.component.FileItem.Status;
-
/**
* JSF component class
*
*/
public abstract class UIFileUpload extends UIInput {
- public static final String READY = "1";
-
- public static final String UNDER_UPLOAD = "2";
-
- public static final String UPLOADING = "3";
-
- private String uploadStatus = READY;
-
private String localContentType;
private String localFileName;
@@ -37,12 +17,9 @@
private Integer localFileSize;
private InputStream localInputStream;
-
- private List<FileItem> fileItems;
- private UIComponent progressBar;
+
-
// @Override
// public void processUpdates(FacesContext context) {
// ValueExpression dataBinding = getValueExpression("data");
@@ -96,103 +73,6 @@
// }
// }
- public boolean isReady () {
- return this.getUploadStatus() == READY;
- }
-
- public boolean isUploading () {
- return (this.getUploadStatus() == UPLOADING || this.getUploadStatus() == UNDER_UPLOAD);
- }
-
- public boolean hasFiles () {
- return this.getFileItems().size() > 0;
- }
-
- public Integer getFilesCount() {
- return fileItems.size();
- }
-
- public boolean isCanCleanAll() {
- boolean result = false;
- for (FileItem item : fileItems) {
- if (item.getStatus() != FileItem.Status.IN_PROGRESS) {
- result = true;
- break;
- }
- }
- return result;
- }
-
-
- public FileItem getFileForClean() {
- for (FileItem item : fileItems) {
- if (item.getStatus() != FileItem.Status.IN_PROGRESS) {
- return item;
- }
- }
- return null;
- }
-
- public Integer getFilesCountByStatus (Status status) {
- Integer counter = 0;
- for (FileItem item : fileItems) {
- if (item.getStatus() == status) {
- counter++;
- }
- }
- return counter;
- }
-
- public boolean isCanAdd () {
- boolean result = true;
- Integer max = (Integer)getAttributes().get("maxFiles");
- if (max != null) {
- if (getFilesCountByStatus(Status.UPLOADED) >= max) {
- result = false;
- }
- }
- return result;
- }
-
- public boolean isCanUploadAll () {
- return (null != getFileByStatus(FileItem.Status.ADDED));
- }
-
- public FileItem getFileInProgress () {
- for (FileItem item : fileItems) {
- if (item.getStatus() == FileItem.Status.IN_PROGRESS) {
- return item;
- }
- }
- return null;
- }
-
- public FileItem getFileByStatus (Status status) {
- for (FileItem item : fileItems) {
- if (item.getStatus() == status) {
- return item;
- }
- }
- return null;
- }
-
- public boolean hasFilesInProgress() {
- for (FileItem item : fileItems) {
- if (item.getStatus() == FileItem.Status.IN_PROGRESS) {
- return true;
- }
- }
- return false;
- }
-
- public void markForUpload() {
- for (FileItem item : fileItems) {
- if (item.getStatus() == FileItem.Status.ADDED) {
- item.setStatus(FileItem.Status.MARKED_4_UPLOAD);
- }
- }
- }
-
public String getLocalContentType() {
return localContentType;
}
@@ -237,86 +117,5 @@
public abstract void setStyle(String style);
- /**
- * @return the fileItems
- */
- public List<FileItem> getFileItems() {
- if (fileItems == null) {
- fileItems = new ArrayList<FileItem>();
- }
- return fileItems;
- }
-
-
-
- /**
- * @return the uploadStatus
- */
- public String getUploadStatus() {
- return uploadStatus;
- }
-
- /**
- * @param uploadStatus the uploadStatus to set
- */
- public void setUploadStatus(String uploadStatus) {
- this.uploadStatus = uploadStatus;
- }
-
- /**
- * @param fileItems
- * the fileItems to set
- */
- public void setFileItems(List<FileItem> fileItems) {
- this.fileItems = fileItems;
- }
-
-
-
- private Object[] values;
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIInput#saveState(javax.faces.context.FacesContext)
- */
- @Override
- public Object saveState(FacesContext context) {
- if (values == null) {
- values = new Object[3];
- }
- values[0] = super.saveState(context);
- values[1] = fileItems;
- values[2] = uploadStatus;
- return values;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.component.UIInput#restoreState(javax.faces.context.FacesContext,
- * java.lang.Object)
- */
- @Override
- public void restoreState(FacesContext context, Object state) {
- values = (Object[]) state;
- super.restoreState(context, values[0]);
- fileItems = (List<FileItem>) values[1];
- uploadStatus = (String) values[2];
- }
-
- /**
- * @return the progressBar
- */
- public UIComponent getProgressBar() {
- return progressBar;
- }
-
- /**
- * @param progressBar the progressBar to set
- */
- public void setProgressBar(UIComponent progressBar) {
- this.progressBar = progressBar;
- }
-
+
}
Modified:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java
===================================================================
---
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java 2008-02-19
14:41:47 UTC (rev 6168)
+++
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/ui/renderkit/FileUploadRendererBase.java 2008-02-19
14:43:42 UTC (rev 6169)
@@ -1,11 +1,9 @@
package org.richfaces.org.jboss.seam.ui.renderkit;
+import java.io.File;
import java.io.IOException;
-import java.io.Writer;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import javax.el.ValueExpression;
@@ -13,7 +11,6 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.servlet.ServletRequest;
-import javax.servlet.http.HttpSession;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.context.AjaxContextImpl;
@@ -23,55 +20,35 @@
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.richfaces.component.UIProgressBar;
-import org.richfaces.org.jboss.seam.ui.component.FileItem;
-import org.richfaces.org.jboss.seam.ui.component.ProgressData;
import org.richfaces.org.jboss.seam.ui.component.UIFileUpload;
import org.richfaces.org.jboss.seam.web.MultipartRequest;
import org.richfaces.renderkit.TemplateEncoderRendererBase;
/**
* Class provides base renderer for upload file component
+ *
* @author "Andrey Markavtsov"
- *
+ *
*/
public abstract class FileUploadRendererBase extends
TemplateEncoderRendererBase {
- /** Add file action name */
- private static final String ACTION_ADD_FILE = "add";
-
- /** Upload all files action name */
- private static final String ACTION_UPLOAD_ALL = "uploadall";
-
- /** Upload file action name */
- private static final String ACTION_NEXT = "next";
-
- /** Clear file action name */
- private static final String ACTION_CLEAR_FILE = "clear";
-
- /** Clear all files action name */
- private static final String ACTION_CLEAR_ALL = "clearall";
-
- /** Stop file uploading action name */
- private static final String ACTION_STOP_FILE = "stop";
-
- private static final String ACTION_STOP_ALL = "stopall";
-
/** File name parameter name */
private static final String FILE_NAME_PARAMETER = "fileName";
/** Session bean name to store the percent value of uploading process */
public static final String _percentBeanName = "__percentValue$";
-
+
/** Session bean name to store the percent value of uploading process */
public static final String _progressInfoBeanName = "__ProgressInfo$";
-
-
-
- private static final String _reRenderAllFlag = "reRenderAll";
- /* (non-Javadoc)
- * @see
org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext,
javax.faces.component.UIComponent)
+ private static final String _reRenderAllFlag = "reRenderAll";
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
org.ajax4jsf.renderkit.RendererBase#doDecode(javax.faces.context.FacesContext,
+ * javax.faces.component.UIComponent)
*/
@Override
protected void doDecode(FacesContext context, UIComponent component) {
@@ -80,23 +57,13 @@
.getRequest();
String clientId = component.getClientId(context);
- Map<String, String[]> params = context.getExternalContext()
- .getRequestParameterValuesMap();
-
- AjaxContext ajaxContext = AjaxContextImpl
- .getCurrentInstance(context);
-
- if (!ajaxContext.isAjaxRequest() && !(request instanceof MultipartRequest)) {
- fileUpload.getFileItems().clear();
- fileUpload.setUploadStatus(UIFileUpload.READY);
- }
-
+// Map<String, String[]> params = context.getExternalContext()
+// .getRequestParameterValuesMap();
+//
+// AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance(context);
+
new AjaxEvent(component).queue();
-
- if (params.containsKey(getActionParameterName(clientId))) {
- processEvents(context, component, clientId);
- ajaxContext.addComponentToAjaxRender(component);
- }
+
if (!(request instanceof MultipartRequest)) {
request = unwrapMultipartRequest(request);
}
@@ -110,69 +77,36 @@
.getFileContentType(clientId));
fileUpload.setLocalFileName(multipartRequest.getFileName(clientId));
fileUpload.setLocalFileSize(multipartRequest.getFileSize(clientId));
- onUploadComplete(context, multipartRequest.getFileName(clientId),
+ onUploadComplete(context, multipartRequest.getFile(clientId),
fileUpload);
}
}
-
- private void storeData(FacesContext context, UIFileUpload fileUpload) {
+
+ private void storeData(FacesContext context, UIFileUpload fileUpload, File file) {
ValueExpression data = fileUpload.getValueExpression("data");
if (data != null) {
Class clazz = data.getType(context.getELContext());
if (clazz.isAssignableFrom(Map.class)) {
- Map map = (Map)data.getValue(context.getELContext());
- map.put(fileUpload.getLocalFileName(),fileUpload.getLocalInputStream());
+ Map map = (Map) data.getValue(context.getELContext());
+ map.put(fileUpload.getLocalFileName(), file);
map.isEmpty();
}
}
-
- }
-// public void encodeControlsMarkup(FacesContext context, UIComponent component)
-// throws IOException {
-// UIComponent header = component.getFacet("header");
-// if (header != null) {
-// writeScriptBody(context, header, true);
-// }
-// }
-
- /*
- * (non-Javadoc)
- *
- * @see
org.ajax4jsf.renderkit.RendererBase#encodeBegin(javax.faces.context.FacesContext,
- * javax.faces.component.UIComponent)
- */
- @Override
- public void encodeBegin(FacesContext context, UIComponent component)
- throws IOException {
- AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance();
- ajaxContext.removeRenderedArea(component.getClientId(context));
- ajaxContext.addRenderedArea(component.getClientId(context)
- + ":fileItems");
}
-
- private void onUploadComplete(FacesContext context, String fileName,
+ private void onUploadComplete(FacesContext context, File file,
UIFileUpload fileUpload) {
- Iterator<FileItem> it = fileUpload.getFileItems().iterator();
- while (it.hasNext()) {
- FileItem item = it.next();
- if (FileItem.Status.IN_PROGRESS == item.getStatus()) {
- item.setStatus(FileItem.Status.UPLOADED);
- break;
- }
- }
- fileUpload.setUploadStatus(UIFileUpload.READY);
- storeData(context, fileUpload);
+ storeData(context, fileUpload, file);
try {
- context.responseComplete();
- }catch (Exception e) {
- e.getMessage();
+ context.responseComplete();
+ } catch (Exception e) {
+ e.getMessage();
}
}
-
+
/*
* (non-Javadoc)
*
@@ -184,260 +118,23 @@
return null;
}
- private void processEvents(FacesContext context, UIComponent component,
- String clientId) {
- Map<String, String[]> params = context.getExternalContext()
- .getRequestParameterValuesMap();
- UIFileUpload fileUpload = (UIFileUpload) component;
- String action = params.get(getActionParameterName(clientId))[0];
- if (ACTION_ADD_FILE.equals(action)) {
- processAddFileAction(context, fileUpload, params);
- } else if (ACTION_UPLOAD_ALL.equals(action)) {
- processUploadAllAction(context, fileUpload);
- } else if (ACTION_CLEAR_ALL.equals(action)) {
- processClearAllAction(context, fileUpload);
- } else if (ACTION_CLEAR_FILE.equals(action)) {
- processClearAction(context, fileUpload, params);
- } else if (ACTION_NEXT.equals(action)) {
- processNextAction(context, fileUpload);
- } else if (ACTION_STOP_FILE.equals(action)) {
- processStopFileAction(context, fileUpload, params);
- } else if (ACTION_STOP_ALL.equals(action)) {
- processStopAllAction(context, fileUpload, params);
- }
- }
-
- private void setupSessionAttributes(FacesContext context, UIComponent component) {
- HttpSession session = getSession(context);
- session.setAttribute(_percentBeanName, 0);
- String progressInfo = (String)component.getAttributes().get("progressInfo");
- if (progressInfo != null) {
- session.setAttribute(_progressInfoBeanName,
component.getAttributes().get("progressInfo"));
- session.setAttribute(progressInfo, new ProgressData());
- }
- }
-
- private void tearDownSessionAttributes(FacesContext context, UIComponent component)
{
- HttpSession session = getSession(context);
- session.removeAttribute(_percentBeanName);
- String progressInfo = (String)component.getAttributes().get("progressInfo");
- if (progressInfo != null) {
- session.removeAttribute(_progressInfoBeanName);
- session.removeAttribute(progressInfo);
- }
- }
-
- private void processClearAction(FacesContext context,
- UIFileUpload fileUpload, Map<String, String[]> params) {
- if (params.containsKey(ACTION_CLEAR_FILE)) {
- String[] fileNames = params.get(ACTION_CLEAR_FILE);
- for (String name : fileNames) {
- removeFileItem(name, fileUpload);
- }
- putResponseData(context, getResponseData(fileUpload, null));
- }
- }
-
- private void processStopFileAction(FacesContext context,
- UIFileUpload fileUpload, Map<String, String[]> params) {
- FileItem item = fileUpload.getFileInProgress();
- if (item != null) {
- item.setStatus(FileItem.Status.CANCELLED);
- }
- processNextAction(context, fileUpload);
- }
-
-
- private void processStopAllAction(FacesContext context,
- UIFileUpload fileUpload, Map<String, String[]> params) {
- FileItem item = fileUpload.getFileByStatus(FileItem.Status.IN_PROGRESS);
- if (item != null) {
- item.setStatus(FileItem.Status.CANCELLED);
- }
- putResponseData(context, getResponseData(fileUpload, null));
- }
-
- private void processClearAllAction(FacesContext context,UIFileUpload fileUpload) {
- FileItem item = null;
- while ((item = fileUpload.getFileForClean()) != null) {
- fileUpload.getFileItems().remove(item);
- }
- putResponseData(context, getResponseData(fileUpload, null));
- }
-
-
- private void removeFileItem(String name, UIFileUpload fileUpload) {
- Iterator<FileItem> it = fileUpload.getFileItems().iterator();
- while (it.hasNext()) {
- FileItem item = it.next();
- if (name.equalsIgnoreCase(item.getFullFileName())) {
- fileUpload.getFileItems().remove(item);
- return;
- }
- }
- }
-
- private void processNextAction(FacesContext context,
- UIFileUpload fileUpload) {
- FileItem item = fileUpload.getFileByStatus(FileItem.Status.MARKED_4_UPLOAD);
- if (item != null) {
- item.setStatus(FileItem.Status.IN_PROGRESS);
- setupSessionAttributes(context, fileUpload);
- putResponseData(context, getResponseData(fileUpload, item.getFullFileName()));
- }else {
- tearDownSessionAttributes(context, fileUpload);
- putResponseData(context, getResponseData(fileUpload, null));
- }
- }
-
- private void processUploadAllAction(FacesContext context,
- UIFileUpload fileUpload) {
- fileUpload.markForUpload();
- FileItem toUpload = fileUpload.getFileByStatus(FileItem.Status.MARKED_4_UPLOAD);
- if (toUpload != null) {
- toUpload.setStatus(FileItem.Status.IN_PROGRESS);
- putResponseData(context, getResponseData(fileUpload, toUpload.getFullFileName()));
- setupSessionAttributes(context, fileUpload);
- }else {
- putResponseData(context, getResponseData(fileUpload, null));
- }
- }
-
- private void processAddFileAction(FacesContext context,
- UIFileUpload fileUpload, Map<String, String[]> params) {
- if (params.containsKey(FILE_NAME_PARAMETER)) {
- String[] fileNames = params.get(FILE_NAME_PARAMETER);
- for (String filename : fileNames) {
- FileItem fileItem = new FileItem(filename);
- fileUpload.getFileItems().add(fileItem);
- }
- putResponseData(context, getResponseData(fileUpload, null));
- }
- }
-
- private void putResponseData(FacesContext context, Object data) {
- AjaxContext ajaxContext = AjaxContextImpl.getCurrentInstance(context);
- ajaxContext.setResponseData(data);
- }
-
- private Object getResponseData(UIFileUpload fileUpload, String fileName) {
- Map<String, Object> map = new HashMap<String, Object>();
- Map<String, Object> upload = new HashMap<String, Object>();
- map.put("add", !fileUpload.isCanAdd());
- boolean hasFilesInProgress = fileUpload.hasFilesInProgress();
- upload.put("iscancel", hasFilesInProgress);
- upload.put("disabled", (hasFilesInProgress) ? false :
!fileUpload.isCanUploadAll());
- map.put("upload",upload);
- map.put("clean", !fileUpload.isCanCleanAll());
- if (fileName != null) {
- map.put("filename", fileName);
- }
- return map;
- }
-
- private String getActionParameterName(String clientId) {
- return clientId + "_action";
- }
-
- private HttpSession getSession(FacesContext context) {
- if (context.getExternalContext() != null) {
- return (HttpSession) context.getExternalContext().getSession(false);
- }
- return null;
- }
-
-// public void encodeDate(FacesContext context, UIComponent component)
-// throws IOException {
-// ResponseWriter writer = context.getResponseWriter();
-// writer.write(new Date().toString());
-// }
-
- public String convertFileName(String name) {
- return name.replaceAll("[\\\\]{1}", "\\\\\\\\");
- }
-
public String getStopScript(FacesContext context, UIComponent component)
- throws IOException {
-
- JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(component, context);
- Map options = AjaxRendererUtils.buildEventOptions(context, component);
- ((Map) options.get("parameters")).put("action",
"stop");
- ((Map) options.get("parameters")).put("uid", new
JSReference("uid"));
- ajaxFunction.addParameter(options);
-
- JSFunctionDefinition function = new JSFunctionDefinition("uid");
- function.addParameter("event");
- function.addToBody(ajaxFunction.toScript());
-
- return function.toScript();
- }
-
- public void encodeInitialScript(FacesContext context, UIComponent component)
throws IOException {
- Writer writer = context.getResponseWriter();
- String clientId = component.getClientId(context);
- StringBuffer script = new StringBuffer("\n");
- script.append("new FileUpload('");
- script.append(clientId);
- script.append("','");
- UIComponent container = (UIComponent) AjaxRendererUtils
- .findAjaxContainer(context, component);
- UIComponent form = (UIComponent) AjaxRendererUtils
- .getNestingForm(component);
- String containerId = container.getId();
- String formId = form.getId();
- String actionUrl = AjaxContextImpl.getCurrentInstance(context)
- .getAjaxActionURL(context);
+ JSFunction ajaxFunction = AjaxRendererUtils.buildAjaxFunction(
+ component, context);
+ Map options = AjaxRendererUtils.buildEventOptions(context, component);
+ ((Map) options.get("parameters")).put("action", "stop");
+ ((Map) options.get("parameters")).put("uid", new
JSReference("uid"));
+ ajaxFunction.addParameter(options);
- script.append(containerId).append("','");
- script.append(formId).append("','");
- script.append(actionUrl).append("','");
- script.append(component.getAttributes().get("addStyle"));
- script.append("','");
- script.append(component.getAttributes().get("addStyleDisabled"));
- script.append("','");
- script.append(component.getAttributes().get("uploadStyle"));
- script.append("','");
- script.append(component.getAttributes().get("uploadStyleDisabled"));
- script.append("','");
- script.append(component.getAttributes().get("cancelStyle"));
- script.append("','");
- script.append(component.getAttributes().get("cancelStyleDisabled"));
- script.append("','");
- script.append(component.getAttributes().get("cleanStyle"));
- script.append("','");
- script.append(component.getAttributes().get("cleanStyleDisabled"));
- script.append("');");
+ JSFunctionDefinition function = new JSFunctionDefinition("uid");
+ function.addParameter("event");
+ function.addToBody(ajaxFunction.toScript());
-
- writer.write(script.toString());
+ return function.toScript();
}
-
- public void encodeUpdateButtonScript(FacesContext context, UIComponent component)
- throws IOException {
-// UIFileUpload fileUpload = (UIFileUpload) component;
-// String cliendId = fileUpload.getClientId(context);
-// Writer writer = context.getResponseWriter();
-//
-// StringBuffer buffer = new StringBuffer();
-// buffer.append(getJSScriptStart(cliendId));
-// boolean hasFileInProgress = fileUpload.hasFilesInProgress();
-// buffer.append(".updateUploadButton(").append(hasFileInProgress)
-// .append(",")
-// .append(hasFileInProgress ? false : !fileUpload.isCanUploadAll())
-// .append(");\n");
-//
-// buffer.append(getJSScriptStart(cliendId)).append(".updateAddButton(")
-// .append(!fileUpload.isCanAdd()).append(");\n");
-//
-// buffer.append(getJSScriptStart(cliendId)).append(".updateCleanButton(")
-// .append(!fileUpload.isCanCleanAll()).append(");\n");
-//
-// writer.write(buffer.toString());
- }
-
/**
* Finds an instance of MultipartRequest wrapped within a request or its
* (recursively) wrapped requests.
@@ -475,38 +172,19 @@
return request;
}
+
- public void renderLabel(FacesContext context, UIComponent component,
- FileItem item) throws IOException {
- UIComponent label = getProgressLabel(component);
- Writer writer = context.getResponseWriter();
- if (item.getStatus() == FileItem.Status.UPLOADED) {
- writer.write("<b>Done</b>");
- } else if (item.getStatus() == FileItem.Status.IN_PROGRESS) {
- if (label != null) {
- renderChild(context, label);
- }else {
- writer.write("<b>In progress</b>");
- }
- } else if (item.getStatus() == FileItem.Status.CANCELLED) {
- writer.write("<b>Cancelled</b>");
- }
+ public String getProgressBarId(FacesContext context, UIComponent component)
+ throws IOException {
+ return getProgressBar(context, component).getClientId(context);
}
- public String getProgressBarId(FacesContext context, UIComponent component) throws
IOException {
- return getProgressBar(context, component).getClientId(context);
+ public void renderProgress(FacesContext context, UIComponent component)
+ throws IOException {
+ UIComponent progressBar = getProgressBar(context, component);
+ renderChild(context, progressBar);
}
-
- public void renderProgress(FacesContext context, UIComponent component) throws
IOException {
- UIComponent progressBar = getProgressBar(context, component);
- renderChild(context, progressBar);
- }
-
- public boolean isCanClear (FileItem item) {
- return item.getStatus() != FileItem.Status.IN_PROGRESS;
- }
-
-
+
private UIComponent createProgressBar(FacesContext context,
UIComponent fileUpload) {
UIComponent progressBar = fileUpload.getFacet("progress");
@@ -530,6 +208,8 @@
Integer.class);
progressBar.setValueExpression("value", ex);
progressBar.setId("progressBar");
+ progressBar.getAttributes().put("minValue", -1);
+ progressBar.getAttributes().put("enabled", false);
progressBar.setTransient(false);
if (getProgressLabel(component) != null) {
progressBar.getAttributes().put("reRender", "progressLabel");
@@ -537,13 +217,13 @@
return progressBar;
}
-
+
private StringBuffer getJSScriptStart(String clientId) {
StringBuffer buffer = new StringBuffer("$('");
buffer.append(clientId).append("').component");
return buffer;
}
-
+
private UIComponent getProgressLabel(UIComponent component) {
UIComponent label = component.getFacet("progressLabel");
if (label != null) {
@@ -551,9 +231,8 @@
}
return label;
}
-
-
- /*
+
+ /*
* (non-Javadoc)
*
* @see
org.richfaces.renderkit.TemplateEncoderRendererBase#encodeChildren(javax.faces.context.FacesContext,
Modified:
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartRequest.java
===================================================================
---
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartRequest.java 2008-02-19
14:41:47 UTC (rev 6168)
+++
trunk/sandbox/ui/fileUpload/src/main/java/org/richfaces/org/jboss/seam/web/MultipartRequest.java 2008-02-19
14:43:42 UTC (rev 6169)
@@ -120,10 +120,14 @@
private ByteArrayOutputStream bOut = null;
private FileOutputStream fOut = null;
private File tempFile = null;
-
+
public FileParam(String name) {
super(name);
}
+
+ public File getFile() {
+ return tempFile;
+ }
public String getFilename() {
return filename;
@@ -568,7 +572,14 @@
return (p != null && p instanceof FileParam) ? ((FileParam) p)
.getContentType() : null;
}
+
+ public File getFile(String name) {
+ Param p = getParam(name);
+ return (p != null && p instanceof FileParam) ? ((FileParam) p)
+ .getFile() : null;
+ }
+
public String getFileName(String name) {
Param p = getParam(name);
return (p != null && p instanceof FileParam) ? ((FileParam) p)
Modified:
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js
===================================================================
---
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-19
14:41:47 UTC (rev 6168)
+++
trunk/sandbox/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/js/FileUpload.js 2008-02-19
14:43:42 UTC (rev 6169)
@@ -52,7 +52,7 @@
[
new ET(function (context) { return
Richfaces.evalMacro("fileName", context)})
]),
- new E('div',{'id':'progress'}),
+ new E('div',{ }),
new E('div',{'className':'upload_name_padding'},
[
new ET(function (context) { return Richfaces.evalMacro("label",
context)})
@@ -124,13 +124,24 @@
this.entryElement.component = this;
this.statusLabel = this.entryElement.rows[0].cells[0].lastChild;
this.controlArea = this.entryElement.rows[0].cells[1].firstChild;
+ this.progressArea = this.entryElement.rows[0].cells[0].childNodes[1];
},
upload: function() {
this.setState(FileUploadEntry.UPLOAD_IN_PROGRESS);
+ this.setupProgressBar();
this.uploadObject.submitForm(this);
},
+ setupProgressBar: function () {
+ this.progressArea.appendChild(this.uploadObject._progressBar);
+ this.uploadObject.prepareProgressBar();
+ },
+
+ finishProgressBar: function () {
+ this.uploadObject.finishProgressBar();
+ },
+
stop: function() {
this.uploadObject.stopScript(this.uid);
},
@@ -138,11 +149,18 @@
_clearInput: function() {
//remove input type="file" element
Richfaces.removeNode(this.fileInput);
+ /*var inputs = $(this.uploadObject.id + ":add1")
+ try{
+ inputs.removeChild(this.fileInput);
+ }catch(e) {}*/
this.fileInput = null;
},
_clearEntry: function() {
Richfaces.removeNode(this.entryElement);
+ /*try{
+ this.uploadObject.items.removeChild(this.entryElement);
+ }catch(e) {}*/
this.entryElement = null;
},
@@ -150,7 +168,7 @@
this._clearInput();
this._clearEntry();
},
-
+
setState: function(newState) {
var oldState = this.state;
this.state = newState;
@@ -247,10 +265,10 @@
});
-FileUpload1 = {};
-FileUpload1 = Class.create();
+FileUpload = {};
+FileUpload = Class.create();
-Object.extend(FileUpload1.prototype, {
+Object.extend(FileUpload.prototype, {
idCounter: 0,
@@ -271,7 +289,9 @@
initialize: function(id, stopScript, progressBarId, options) {
this.id = id;
this.element = $(this.id);
- this.progressBar = $(progressBarId).component;
+ //this.progressBarId = progressBarId;
+ this._progressBar = $(progressBarId);
+ this.progressBar = this._progressBar.component;
this.element.component = this;
@@ -284,6 +304,17 @@
this.setupAutoUpload();
},
+ prepareProgressBar: function () {
+ this.progressBar.setValue(0);
+ Element.show(this._progressBar);
+ },
+
+ finishProgressBar: function () {
+ this.progressBar.disable();
+ this.progressBar.setValue(100);
+ Element.hide(this._progressBar);
+ },
+
setupAutoUpload: function() {
this.runUpload = this.options.autoUpload;
},
@@ -369,8 +400,9 @@
_endUpload: function() {
this.activeEntry = null;
- this.progressBar.setValue(0);
- this.progressBar.disable();
+ //this.progressBar.setValue(100);
+ //this.progressBar.disable();
+ //Element.hide(this._progressBar);
},
_updateEntriesState: function() {
@@ -488,6 +520,7 @@
if (!parentForm.onsubmit || parentForm.onsubmit()) {
var iframe = this.iframe;
new LoadWatcher(iframe, function(newState) {
+ this.finishProgressBar();
this.setState(newState);
}.bind(entry));
@@ -516,347 +549,3 @@
});
-FileUpload = {};
-FileUpload = Class.create();
-FileUpload.Uploaders = {};
-Object.extend(FileUpload.prototype, {
- initialize: function(id, containerId, formId, actionUrl, addStyle, addStyleDisabled,
uploadStyle, uploadStyleDisabled, cancelStyle, cancelStyleDisabled, cleanStyle,
cleanStyleDisabled) {
- this.id = id;
- this.containerId = containerId;
- this.formId = formId;
- this.actionUrl = actionUrl;
- this.createForm();
- this.f = $(id + ":files");
- this.fm = $(id + ":f");
- this.fr = $(id + ":fr");
- this.addStyle = addStyle;
- this.addStyleDisabled = addStyleDisabled;
- this.uploadStyle = uploadStyle;
- this.uploadStyleDisabled = uploadStyleDisabled;
- this.cancelStyle = cancelStyle;
- this.cancelStyleDisabled = cancelStyleDisabled;
- this.cleanStyle = cleanStyle;
- this.cleanStyleDisabled = cleanStyleDisabled;
- this.canAddAll = true;
- this.canUploadAll = false;
- this.canCleanAll = false;
- $(this.id).component = this;
- },
- renderControl: function (template, context) {
- if (!template) {
- return;
- }
- var html = template.invoke('getContent', context).join('');
- $(this.id + ":header").innerHTML = html;
- },
- setClassName: function (o , className) {
- o.className = className;
- },
- updateCleanButton: function(disabled) {
- this.canCleanAll = !disabled;
-
this.updateButton($(this.id+":clean1"),$(this.id+":clean2"),this.cleanStyle,this.cleanStyleDisabled,"clear",disabled);
- },
- updateAddButton: function(disabled) {
- this.canAddAll = !disabled;
-
this.updateButton($(this.id+":add1"),$(this.id+":add2"),this.addStyle,this.addStyleDisabled,"add",disabled);
- },
- updateUploadButton: function (isCancel, disabled) {
- this.canUploadAll = !disabled;
- var d = $(this.id + ":upload1");
- var l = $(this.id + ":upload2");
- if (d && l) {
- var cancelButton = Element.firstDescendant(l);
- var uploadButton = cancelButton.next();
-
- if (isCancel) {
- cancelButton.show();
- uploadButton.hide();
-
-
this.updateButton(d,l,this.cancelStyle,this.cancelStyleDisabled,"start",disabled);
- d.onclick = function () { this.stopAll(); }.bind(this);
- }else {
- uploadButton.show();
- cancelButton.hide();
-
-
this.updateButton(d,l,this.uploadStyle,this.uploadStyleDisabled,"start",disabled);
- d.onclick = function () { this.uploadAll(); }.bind(this);
- }
-
- }
- },
- updateButton: function (o1,o2, style, styleDis, prefix ,disabled) {
- if (disabled) {
- this.setClassName(o1, "upload_button_dis upload_font "+ styleDis);
- this.setClassName(o2, "upload_button_content upload_font upload_ico
upload_ico_"+prefix+"_dis "+styleDis);
- }else {
- this.setClassName(o1, "upload_button upload_font "+ style);
- this.setClassName(o2, "upload_button_content upload_font upload_ico
upload_ico_"+prefix+" "+style);
- }
- },
- processResponseData: function (data) {
- if (data) {
- var add = data['add'];
- if (add != null) {
- this.updateAddButton(add);
- }
- var upload = data['upload'];
- this.updateUploadButton(upload['iscancel'],upload['disabled']);
- var clean = data['clean'];
- if (clean != null) {
- this.updateCleanButton(clean);
- }
- }
- },
- sendAjaxRequest: function (params, oncomplete) {
- var options = {};
- options['actionUrl'] = this.actionUrl;
- var p = options['parameters'] = {};
- p[this.id] = this.id;
- if (params) {
- for (var param in params) {
- p[param] = params[param];
- }
- }
- if (oncomplete) {
- options['oncomplete'] = oncomplete;
- }
- A4J.AJAX.Submit(this.containerId,this.formId,null,options);
- },
- add: function () {
- if (!this.canAddAll) return;
- var oncomplete = function(request, event, data) {
- this._add();
- this.processResponseData(data);
- }.bind(this);
- var params = {};
- params[this.id + "_action"] = 'add';
- this.sendAjaxRequest(params, oncomplete);
- return false;
- },
- _add: function (){
- var o = $(this.id + ":file");
- var parent = o.parentNode;
-
- var clon = o.cloneNode(true);
- clon.id = this.id + ":file";
- clon.name = "fileName";
-
- o.id = "add";
- o.name = "add";
- o.disabled = true;
- o.style.display = "none";
-
- this.f.appendChild(o);
-
- parent.appendChild(clon);
- },
- addViewState: function () {
- if (!this.fm['javax.faces.ViewState']) {
- var d = document.createElement("input");
- d.type="hidden";
- d.name = "javax.faces.ViewState";
- d.value = $("javax.faces.ViewState").value;
- this.fm.appendChild(d);
- }
- },
- uploadAll: function () {
- if (!this.canUploadAll) return;
- if (this.getFilesCount() == 0) return;
- var oncomplete = function(request, event, data) {
- this.processResponseData(data);
- if (data['filename']) {
- this._upload(data['filename']);
- }
- }.bind(this);
- var params = {};
- params[this.id + "_action"] = 'uploadall';
- this.sendAjaxRequest(params, oncomplete);
- return false;
- },
- _upload: function (name) {
- var v = this.findFileByName(name);
- this.addViewState();
- this.prepareUpload();
- if (v) {
- v.disabled = false;
- v.name = this.id + ":1";
- v.id = v.name;
- this.fm.submit();
- }
- },
- next: function (ev) {
- var params = {};
- params[this.id + "_action"] = "next";
- var oncomplete = function(request, event, data) {
- this.processResponseData(data);
- if (data['filename']) {
- this._upload(data['filename']);
- }
- }.bind(this);
- this.sendAjaxRequest(params, oncomplete);
- },
- onFileUploaded: function (ev) {
- var d = $(this.id).component;
- if (d.canceled == true) {
- d.canceled = false;
- return;
- }
- var i = $(this.id + ":1");
- if (i) {
- this.finishProgressBar();
- i.disabled = true;
- i.id = "";
- i.name = "";
- this.next(ev);
- }
- },
- finishProgressBar: function () {
- var prBar = $(this.formId + ":progressBar");
- if (prBar) {
- prBar.component.disable();
- prBar.component.setValue(100);
- }
- },
- createForm: function () {
- if ($(this.id + ":fr")) return;
- var fr = document.createElement("iframe");
- fr.id = this.id + ":fr";
- fr.name = fr.id;
- fr.style.display="none";
- fr.src = "about:blank";
- fr.onload = function(request, event, data) {
- this.onFileUploaded(event);
- }.bind(this);
-
-
- document.body.insertBefore(fr, null);
-
- var f = document.createElement("form");
- f.enctype = "multipart/form-data";
- f.action = this.actionUrl;
- f.method = "post";
- f.id = this.id + ":f";
- f.target = this.id + ":fr";
-
- var d = document.createElement("div");
- d.id = this.id + ":files";
- f.appendChild(d);
- //--
- d = document.createElement("input");
- d.type="hidden";
- d.name = this.formId;
- d.value = d.name;
- f.appendChild(d);
-
- document.body.insertBefore(f, null);
- //--
- },
- getFilesCount: function () {
- if (this.f.hasChildNodes()) {
- return this.f.childNodes.length;
- }
- return 0;
- },
- cleanAll: function () {
- if (!this.canCleanAll) return;
- var params = {}
- params[this.id + "_action"] = "clearall";
- var oncomplete = function (request, event, data) {
- this.processResponseData(data);
- this._cleanAll();
- }.bind(this);
- this.sendAjaxRequest(params, oncomplete);
- return false;
- },
- _cleanAll: function() {
- this.removeChilds(this.f);
- },
- stopRequest: function () {
- this.canceled = true;
- this.fr.src = "about:blank";
- },
- stop: function () {
- $(this.formId+":progressBar").component.disable();
- this.stopRequest();
- var f = $(this.id + ":1");
- if (f) {
- f.disabled = true;
- f.id = "add";
- f.name = f.id;
- }
- var params = {}
- params[this.id + "_action"] = "stop";
- var oncomplete = function (request, event, data) {
- this.processResponseData(data);
- if (data['filename']) {
- this._upload(data['filename']);
- }
- }.bind(this);
- this.sendAjaxRequest(params, oncomplete);
- return false;
- },
- stopAll: function () {
- this.stopRequest();
- var params = {}
- params[this.id + "_action"] = "stopall";
- var oncomplete = function (request, event, data) {
- this.processResponseData(data);
- }.bind(this);
- this.sendAjaxRequest(params, oncomplete);
- return false;
- },
- prepareUpload: function () {
- for (var i = 0; i < this.f.childNodes.length; i++) {
- this.f.childNodes[i].disabled = true;
- this.f.childNodes[i].name="";
- this.f.childNodes[i].id="";
- }
- },
- removeChilds: function (f) {
- if (f && f.hasChildNodes && f.removeChild) {
- while (f.hasChildNodes()) {
- f.removeChild(f.firstChild);
- }
- }
- },
- reduce: function (confirmId, id) {
- var confirm = $(confirmId);
- var d = $(id);
- if (confirm)
- Element.hide(confirm);
- if (d)
- Element.show(d);
- return false;
- },
- confirm: function (confirmId, id) {
- Element.show($(confirmId));
- Element.hide($(id));
- window.setTimeout("$('"+this.id+"').component.reduce('"+confirmId+"','"+id+"');",
3000);
- return false;
- },
- findFileByName: function(name) {
- for (var i = 0; i < this.getFilesCount(); i++) {
- var d = this.f.childNodes[i];
- if (d.value == name) { return d; }
- }
- return null;
- },
- clear: function (name) {
- var v = this.findFileByName(name);
- if (!v) return;
- var params = {}
- params[this.id + "_action"] = "clear";
- params["clear"] = name;
- var oncomplete = function (request, event, data) {
- this.processResponseData(data);
- this._clear(v);
- }.bind(this);
- this.sendAjaxRequest(params, oncomplete);
- return false;
- },
- _clear: function (v) {
- if (v) {
- this.f.removeChild(v);
- }
- }
- });
Modified: trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
---
trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-02-19
14:41:47 UTC (rev 6168)
+++
trunk/sandbox/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-02-19
14:43:42 UTC (rev 6169)
@@ -23,19 +23,17 @@
<f:clientId var="clientId" />
<div class="upload_list_width upload_list_decor"
id="#{clientId}">
- <iframe name="#{clientId}" id="#{clientId}_iframe" />
-<span style="display: none">
- <script type="text/javascript">
- /*<!-- f:call name="encodeInitialScript" / -->*/
- </script>
-</span>
+<iframe name="#{clientId}" id="#{clientId}_iframe"
style="display: none;"/>
+
+<span style="display: none;">
<jsp:scriptlet>
<![CDATA[
renderProgress(context, component);
]]>
</jsp:scriptlet>
+</span>
<table class="upload_toolbar_decor">
<tr>
@@ -103,99 +101,11 @@
<div class="upload_list_width upload_list_overflow"
id="#{clientId}:fileItems">
- <!-- jsp:scriptlet>
- <![CDATA[
- Iterator<org.richfaces.org.jboss.seam.ui.component.FileItem> it =
component.getFileItems().iterator();
- Integer i = 0;
- while (it.hasNext()) {
- org.richfaces.org.jboss.seam.ui.component.FileItem item = it.next();
- String fullFileName = item.getFullFileName();
- String fileName = item.getFileName();
- variables.setVariable("fileName",fileName);
- variables.setVariable("fullFileName",fullFileName);
- variables.setVariable("fullFileNameJs",convertFileName(fullFileName));
- variables.setVariable("n",i);
- ]]>
- </jsp:scriptlet>
-
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="upload_font upload_name upload_table_td">
- <div class="upload_name_padding">
- #{fileName}
- </div>
-
- <jsp:scriptlet>
- <![CDATA[
- renderProgress(context, component, item);
- ]]>
- </jsp:scriptlet>
-
-
- <div class="upload_name_padding">
- <jsp:scriptlet>
- <![CDATA[
- renderLabel(context, component, item);
- ]]>
- </jsp:scriptlet>
- </div>
-
-
- </td>
- <td class="upload_table_td" style="vertical-align:
center;">
- <jsp:scriptlet>
- <![CDATA[
- if (isCanClear(item)) {
- ]]>
- </jsp:scriptlet>
- <div class="upload_font upload_del">
- <a href="#" class="upload_anc"
id="#{clientId}:clear#{n}"
- onclick="return
$('#{clientId}').component.confirm('#{clientId}:cconfirm#{n}','#{clientId}:clear#{n}');"
- style="text-decoration: none; color:black">Clear</a>
- <span id="#{clientId}:cconfirm#{n}"
style="display:none">
- <a href="#" onclick="return
$('#{clientId}').component.clear('#{fullFileNameJs}');"
style="text-decoration: none; color:black">Yes</a>
- <a href="#"
onclick="$('#{clientId}').component.reduce('#{clientId}:cconfirm#{n}','#{clientId}:clear#{n}');"
style="text-decoration: none; padding-left: 10px; color:black">No</a>
- </span>
- </div>
- <jsp:scriptlet>
- <![CDATA[
- } else {
- ]]>
- </jsp:scriptlet>
- <div class="upload_font upload_del">
- <a href="#" class="upload_anc"
id="#{clientId}:stop#{n}"
- onclick="return
$('#{clientId}').component.confirm('#{clientId}:sconfirm#{n}','#{clientId}:stop#{n}');"
- style="text-decoration: none; color:black">Stop</a>
- <span id="#{clientId}:sconfirm#{n}"
style="display:none">
- <a href="#" onclick="return
$('#{clientId}').component.stop();" style="text-decoration: none;
color:black">Yes</a>
- <a href="#"
onclick="$('#{clientId}').component.reduce('#{clientId}:sconfirm#{n}','#{clientId}:stop#{n}');"
style="text-decoration: none; padding-left: 10px; color:black">No</a>
- </span>
- </div>
-
- <jsp:scriptlet>
- <![CDATA[
- }
- ]]>
- </jsp:scriptlet>
- </td>
- <td class="upload_table_td">
- <div class="upload_font upload_scroll"></div>
- </td>
- </tr>
- </table>
-
- <jsp:scriptlet>
- <![CDATA[
- i++;
- }
- ]]>
- </jsp:scriptlet-->
-
</div>
+
<span>
<script type="text/javascript">
- new FileUpload1('#{clientId}', #{this:getStopScript(context, component)},
'#{this:getProgressBarId(context, component)}');
- /*<!-- f:call name="encodeUpdateButtonScript" / -->*/
+ new FileUpload('#{clientId}', #{this:getStopScript(context, component)},
'#{this:getProgressBarId(context, component)}');
</script>
</span>