Author: ilya_shaikovsky
Date: 2008-08-07 06:13:56 -0400 (Thu, 07 Aug 2008)
New Revision: 9967
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/FileUploadBean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/examples/fileUpload.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-3910
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/FileUploadBean.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/FileUploadBean.java 2008-08-07
10:13:17 UTC (rev 9966)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/FileUploadBean.java 2008-08-07
10:13:56 UTC (rev 9967)
@@ -19,6 +19,7 @@
private ArrayList<File> files = new ArrayList<File>();
private int uploadsAvailable = 5;
private boolean autoUpload = false;
+ private boolean useFlash = false;
public int getSize() {
if (getFiles().size()>0){
return getFiles().size();
@@ -78,4 +79,12 @@
this.autoUpload = autoUpload;
}
+ public boolean isUseFlash() {
+ return useFlash;
+ }
+
+ public void setUseFlash(boolean useFlash) {
+ this.useFlash = useFlash;
+ }
+
}
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/examples/fileUpload.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/examples/fileUpload.xhtml 2008-08-07
10:13:17 UTC (rev 9966)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/examples/fileUpload.xhtml 2008-08-07
10:13:56 UTC (rev 9967)
@@ -22,7 +22,7 @@
maxFilesQuantity="#{fileUploadBean.uploadsAvailable}"
reRender="table" id="upload"
immediateUpload="#{fileUploadBean.autoUpload}"
- acceptedTypes="jpg, gif, png, bmp">
+ acceptedTypes="jpg, gif, png, bmp"
allowFlash="#{fileUploadBean.useFlash}">
<a4j:support event="onuploadcomplete" reRender="info" />
</rich:fileUpload>
<h:panelGroup id="info">
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml 2008-08-07
10:13:17 UTC (rev 9966)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml 2008-08-07
10:13:56 UTC (rev 9967)
@@ -38,12 +38,27 @@
just after file added to list. But you could freely manage the list (add
or remove some files from list while upload performed)
</p>
- <h:outputText value="Turn Automatic upload on:"/>
+ <p>
+ Also starting from 3.2.2 version File Upload could be configured to use flash
+ object in order to provide additional features (covered in developer guide)
+ to component.
+ </p>
<h:form>
- <h:selectBooleanCheckbox value="#{fileUploadBean.autoUpload}">
- <a4j:support event="onclick" reRender="upload"/>
- </h:selectBooleanCheckbox>
- </h:form>
+ <h:panelGrid columns="2">
+ <h:panelGroup>
+ <h:outputText value="Turn Automatic upload on:"/>
+ <h:selectBooleanCheckbox value="#{fileUploadBean.autoUpload}">
+ <a4j:support event="onclick" reRender="upload"
ajaxSingle="true"/>
+ </h:selectBooleanCheckbox>
+ </h:panelGroup>
+ <h:panelGroup>
+ <h:outputText value="Turn using flash on:"/>
+ <h:selectBooleanCheckbox value="#{fileUploadBean.useFlash}">
+ <a4j:support event="onclick" reRender="upload"
ajaxSingle="true"/>
+ </h:selectBooleanCheckbox>
+ </h:panelGroup>
+ </h:panelGrid>
+ </h:form>
<p>
In this example file types restricted to jpg, gif, png and bmp files using
<b>acceptedTypes </b>attribute.
</p>
@@ -62,9 +77,6 @@
(1000000 for this example).
</li>
</ul>
- <p>
-
- </p>
</fieldset>
</ui:define>