Author: mvitenkov
Date: 2008-07-17 10:40:28 -0400 (Thu, 17 Jul 2008)
New Revision: 9660
Modified:
trunk/test-applications/jsp/src/main/java/fileUpload/FileUpload.java
Log:
Modified: trunk/test-applications/jsp/src/main/java/fileUpload/FileUpload.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/fileUpload/FileUpload.java 2008-07-17
14:20:34 UTC (rev 9659)
+++ trunk/test-applications/jsp/src/main/java/fileUpload/FileUpload.java 2008-07-17
14:40:28 UTC (rev 9660)
@@ -49,7 +49,16 @@
private boolean noDuplicate;
private boolean ajaxSingle;
private boolean immediate;
+ private int uploadsAvailable;
+ public int getUploadsAvailable() {
+ return uploadsAvailable;
+ }
+
+ public void setUploadsAvailable(int uploadsAvailable) {
+ this.uploadsAvailable = uploadsAvailable;
+ }
+
public void addHtmlFileUpload(){
ComponentInfo info = ComponentInfo.getInstance();
info.addField(myFileUpload);
@@ -89,7 +98,7 @@
acceptedTypes = "*";
requiredMessage = "requiredMessage";
listHeight = "200px";
- listWidth = "150px";
+ listWidth = "400px";
maxFilesQuantity = 3;
align = "left";
bindLabel = "not ready";
@@ -112,6 +121,7 @@
allowFlash = "false";
ajaxSingle = false;
immediate = false;
+ uploadsAvailable = 5;
}
public void fileUploadListener(UploadEvent event) throws Exception{
@@ -125,7 +135,20 @@
}
System.out.println("FileUpload.fileUploadListener()");
}
+
+ public void listener(UploadEvent event) throws Exception {
+ try {
+ UploadItem item = event.getUploadItem();
+ System.out.println("File : " + item.getFileName() + " was
uploaded");
+ uploadsAvailable--;
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
public void checkBinding(ActionEvent actionEvent){
FacesContext context = FacesContext.getCurrentInstance();
bindLabel = myFileUpload.getClientId(context);
Show replies by date