Author: mvitenkov
Date: 2008-04-29 09:02:06 -0400 (Tue, 29 Apr 2008)
New Revision: 8305
Modified:
trunk/test-applications/facelets/src/main/java/fileUpload/FileUpload.java
trunk/test-applications/facelets/src/main/webapp/FileUpload/FileUpload.xhtml
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataTable.xml
Log:
UploadedItem.file.name testing
Modified: trunk/test-applications/facelets/src/main/java/fileUpload/FileUpload.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/fileUpload/FileUpload.java 2008-04-29
12:58:13 UTC (rev 8304)
+++ trunk/test-applications/facelets/src/main/java/fileUpload/FileUpload.java 2008-04-29
13:02:06 UTC (rev 8305)
@@ -20,6 +20,7 @@
private String listWidth;
private ArrayList data;
private Integer maxFilesQuantity;
+ private UploadItem upload;
public FileUpload() {
data = new ArrayList();
@@ -32,12 +33,13 @@
listHeight = "200px";
listWidth = "150px";
maxFilesQuantity = 3;
+ upload = null;
}
public void fileUploadListener(UploadEvent event) throws Exception{
- UploadItem upload = event.getUploadItem();
+ upload = event.getUploadItem();
if (upload.isTempFile()) {
- File file = upload.getFile();
+ File file = upload.getFile();
} else {
ByteArrayOutputStream b = new ByteArrayOutputStream();
b.write(upload.getData());
@@ -123,4 +125,12 @@
public void setData(ArrayList data) {
this.data = data;
}
+
+ public UploadItem getUpload() {
+ return upload;
+ }
+
+ public void setUpload(UploadItem upload) {
+ this.upload = upload;
+ }
}
Modified: trunk/test-applications/facelets/src/main/webapp/FileUpload/FileUpload.xhtml
===================================================================
---
trunk/test-applications/facelets/src/main/webapp/FileUpload/FileUpload.xhtml 2008-04-29
12:58:13 UTC (rev 8304)
+++
trunk/test-applications/facelets/src/main/webapp/FileUpload/FileUpload.xhtml 2008-04-29
13:02:06 UTC (rev 8305)
@@ -35,5 +35,11 @@
<h:outputText value="requiredMessage"></h:outputText>
<h:inputText value="#{fileUpload.requiredMessage}"
onchange="submit();"></h:inputText>
+
+ <h:panelGrid columns="2">
+ <h:outputText value="File name:"></h:outputText>
+ <h:outputText
value="#{fileUpload.upload.file.name}"></h:outputText>
+ </h:panelGrid>
+
</h:panelGrid>
</f:subview>
\ No newline at end of file
Modified:
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataTable.xml
===================================================================
---
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataTable.xml 2008-04-29
12:58:13 UTC (rev 8304)
+++
trunk/test-applications/facelets/src/main/webapp/WEB-INF/faces-config-DataTable.xml 2008-04-29
13:02:06 UTC (rev 8305)
@@ -7,4 +7,22 @@
<managed-bean-class>dataTable.DataTable</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>testBean</managed-bean-name>
+ <managed-bean-class>dataTable.TestBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>table</managed-bean-name>
+ <managed-bean-class>dataTable.Table</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>cell</managed-bean-name>
+ <managed-bean-class>dataTable.Cell</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
</faces-config>