Author: ilya_shaikovsky
Date: 2008-03-26 10:00:15 -0400 (Wed, 26 Mar 2008)
New Revision: 7257
Added:
trunk/samples/richfaces-demo/src/main/webapp/images/cn_FileUpload.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_PickList.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ProgressBar.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_TableFiltering.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_TableSorting.gif
trunk/samples/richfaces-demo/src/main/webapp/images/ico_FileUpload.gif
trunk/samples/richfaces-demo/src/main/webapp/images/ico_TableFiltering.gif
trunk/samples/richfaces-demo/src/main/webapp/images/ico_TableSorting.gif
trunk/samples/richfaces-demo/src/main/webapp/images/ico_pickList.gif
trunk/samples/richfaces-demo/src/main/webapp/images/ico_progressBar.gif
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/File.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/FileUploadBean.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/examples/fileUpload.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml
Log:
new icons
File upload example finished
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/File.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/File.java 2008-03-26
13:34:11 UTC (rev 7256)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/File.java 2008-03-26
14:00:15 UTC (rev 7257)
@@ -4,6 +4,13 @@
private String Name;
private long length;
+ private byte[] data;
+ public byte[] getData() {
+ return data;
+ }
+ public void setData(byte[] data) {
+ this.data = data;
+ }
public String getName() {
return Name;
}
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-03-26
13:34:11 UTC (rev 7256)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/FileUploadBean.java 2008-03-26
14:00:15 UTC (rev 7257)
@@ -4,6 +4,7 @@
package org.richfaces.demo.fileUpload;
import java.io.IOException;
+import java.io.OutputStream;
import java.util.ArrayList;
import org.richfaces.event.UploadEvent;
@@ -16,7 +17,8 @@
public class FileUploadBean{
private ArrayList<File> files = new ArrayList<File>();
-
+ private int uploadsAvailable = 5;
+ private boolean autoUpload = false;
public int getSize() {
if (getFiles().size()>0){
return getFiles().size();
@@ -29,14 +31,25 @@
public FileUploadBean() {
}
+ public void paint(OutputStream stream, Object object) throws IOException {
+ stream.write(getFiles().get((Integer)object).getData());
+ }
public void listener(UploadEvent event) throws IOException{
UploadItem item = event.getUploadItem();
File file = new File();
file.setLength(item.getData().length);
file.setName(item.getFileName());
+ file.setData(item.getData());
files.add(file);
+ uploadsAvailable--;
}
+ public String clearUploadData() {
+ files.clear();
+ setUploadsAvailable(5);
+ return null;
+ }
+
public ArrayList<File> getFiles() {
return files;
}
@@ -45,4 +58,20 @@
this.files = files;
}
+ public int getUploadsAvailable() {
+ return uploadsAvailable;
+ }
+
+ public void setUploadsAvailable(int uploadsAvailable) {
+ this.uploadsAvailable = uploadsAvailable;
+ }
+
+ public boolean isAutoUpload() {
+ return autoUpload;
+ }
+
+ public void setAutoUpload(boolean autoUpload) {
+ this.autoUpload = autoUpload;
+ }
+
}
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
---
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-03-26
13:34:11 UTC (rev 7256)
+++
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-03-26
14:00:15 UTC (rev 7257)
@@ -69,15 +69,15 @@
portlet= ajaxMisc, Ajax Portlet, /images/ico_common.gif,
/images/cn_AjaxPortlet.gif,
RichFacesComponentsLibrary.html#portlet,
jbossajax4jsf/freezone/docs/tlddoc/a4j/portlet.html,
jbossajax4jsf/freezone/docs/apidoc/org/ajax4jsf/ajax/UIPortlet.html,
/richfaces/portlet.jsf
effect= richMisc, Effect, /images/ico_common.gif,
/images/cn_Effect.gif,
RichFacesComponentsLibrary.html#effect,
jbossrichfaces/freezone/docs/tlddoc/rich/effect.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIEffect.html,
/richfaces/effect.jsf
contextMenu= richMenu, Context Menu, /images/ico_ContextMenu.gif,
/images/cn_contextMenu.gif,
RichFacesComponentsLibrary.html\#contextMenu,
jbossrichfaces/freezone/docs/tlddoc/rich/contextMenu.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIContextMenu.html,
/richfaces/contextMenu.jsf
-componentControl= richMisc, Component Control, /images/ico_common.gif,
\t\t/images/cn_componentControl.gif,
RichFacesComponentsLibrary.html\#componentControl,
jbossrichfaces/freezone/docs/tlddoc/rich/componentControl.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcomponentControl.html,
/richfaces/componentControl.jsf
-orderingList= richSelect, Ordering List, /images/ico_OrderingList.gif,
\t/images/cn_orderingList.gif, RichFacesComponentsLibrary.html\#orderingList,
jbossrichfaces/freezone/docs/tlddoc/rich/orderingList.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIorderingList.html,
\t\t/richfaces/orderingList.jsf
-listShuttle= richSelect, List Shuttle, /images/ico_ListShuttle.gif,
/images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#listShuttle,
jbossrichfaces/freezone/docs/tlddoc/rich/listShuttle.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIlistShuttle.html,
\t\t/richfaces/listShuttle.jsf
-pickList= richSelect, Pick List, /images/ico_DataTable.gif,
/images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#pickList,
jbossrichfaces/freezone/docs/tlddoc/rich/pickList.html,
\t\tjbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIpickList.html,
\t\t\t\t/richfaces/pickList.jsf
-progressBar= richOutputs, Progress Bar, /images/ico_DataTable.gif,
/images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#progressBar,
jbossrichfaces/freezone/docs/tlddoc/rich/progressBar.html,
\t\tjbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIprogressBar.html,
\t/richfaces/progressBar.jsf
-comboBox= richInputs, Combo Box, /images/ico_ComboBox.gif,
\t\t/images/cn_ComboBox.gif, RichFacesComponentsLibrary.html\#comboBox,
jbossrichfaces/freezone/docs/tlddoc/rich/comboBox.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcomboBox.html,
\t\t\t\t\t/richfaces/comboBox.jsf
+componentControl=richMisc, Component Control, \t/images/ico_common.gif,
\t\t/images/cn_componentControl.gif,
RichFacesComponentsLibrary.html\#componentControl,
jbossrichfaces/freezone/docs/tlddoc/rich/componentControl.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcomponentControl.html,
/richfaces/componentControl.jsf
+orderingList=richSelect, Ordering List, \t\t/images/ico_OrderingList.gif,
\t/images/cn_orderingList.gif, RichFacesComponentsLibrary.html\#orderingList,
jbossrichfaces/freezone/docs/tlddoc/rich/orderingList.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIorderingList.html,
\t\t/richfaces/orderingList.jsf
+listShuttle=richSelect, List Shuttle, \t\t/images/ico_ListShuttle.gif,
/images/cn_listShuttle.gif, RichFacesComponentsLibrary.html\#listShuttle,
jbossrichfaces/freezone/docs/tlddoc/rich/listShuttle.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIlistShuttle.html,
\t\t/richfaces/listShuttle.jsf
+pickList=richSelect, Pick List, \t\t\t/images/ico_pickList.gif,
/images/cn_PickList.gif, RichFacesComponentsLibrary.html\#pickList,
jbossrichfaces/freezone/docs/tlddoc/rich/pickList.html,
\t\tjbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIpickList.html,
\t\t\t\t/richfaces/pickList.jsf
+progressBar=richOutputs, Progress Bar, \t\t/images/ico_progressBar.gif,
/images/cn_ProgressBar.gif, RichFacesComponentsLibrary.html\#progressBar,
jbossrichfaces/freezone/docs/tlddoc/rich/progressBar.html,
\t\tjbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIprogressBar.html,
\t/richfaces/progressBar.jsf
+comboBox=richInputs, Combo Box, \t\t/images/ico_ComboBox.gif,
\t\t/images/cn_ComboBox.gif, RichFacesComponentsLibrary.html\#comboBox,
jbossrichfaces/freezone/docs/tlddoc/rich/comboBox.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcomboBox.html,
\t\t\t\t\t/richfaces/comboBox.jsf
inplaceInput= richInputs, Inplace Input, /images/ico_InplaceInput.gif,
\t\t/images/cn_InplaceInput.gif,
RichFacesComponentsLibrary.html\#inplaceInput,
jbossrichfaces/freezone/docs/tlddoc/rich/inplaceInput.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIinplaceInput.html,
\t\t\t\t\t/richfaces/inplaceInput.jsf
inplaceSelect= richInputs, Inplace Select,
/images/ico_InplaceSelect.gif, \t\t/images/cn_InplaceSelect.gif,
RichFacesComponentsLibrary.html\#inplaceSelect,
jbossrichfaces/freezone/docs/tlddoc/rich/inplaceSelect.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIinplaceSelect.html,
\t\t\t\t\t/richfaces/inplaceSelect.jsf
-sorting= richDataIterators, Table Sorting, /images/ico_DataTable.gif,
\t\t/images/cn_DataTable.gif, RichFacesComponentsLibrary.html\#dataTable,
jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIdataTable.html,
\t\t\t\t\t/richfaces/sortingFeature.jsf
-filtering= richDataIterators, Table Filtering, /images/ico_DataTable.gif,
\t\t/images/cn_DataTable.gif, RichFacesComponentsLibrary.html\#dataTable,
jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIdataTable.html,
\t\t\t\t\t/richfaces/filteringFeature.jsf
-columns = richDataIterators, Columns, /images/ico_columns.gif,
\t\t/images/cn_Columns.gif, \t\t\tRichFacesComponentsLibrary.html\#columns,
jbossrichfaces/freezone/docs/tlddoc/rich/columns.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcolumns.html,
\t\t\t\t\t/richfaces/columns.jsf
-fileUpload = richInputs, File Upload, /images/ico_FileUpload.gif,
\t\t/images/cn_FileUpload.gif,
\t\t\tRichFacesComponentsLibrary.html\#fileUpload,
jbossrichfaces/freezone/docs/tlddoc/rich/fileUpload.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIfileUpload.html,
\t\t\t\t\t/richfaces/fileUpload.jsf
\ No newline at end of file
+sorting=richDataIterators, Table Sorting, \t/images/ico_TableSorting.gif,
\t\t/images/cn_TableSorting.gif, RichFacesComponentsLibrary.html\#dataTable,
jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIdataTable.html,
\t\t\t\t\t/richfaces/sortingFeature.jsf
+filtering=richDataIterators, Table Filtering, \t/images/ico_TableFiltering.gif,
\t\t/images/cn_TableFiltering.gif,
RichFacesComponentsLibrary.html\#dataTable,
jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIdataTable.html,
\t\t\t\t\t/richfaces/filteringFeature.jsf
+columns =richDataIterators, \t Columns, \t\t\t/images/ico_columns.gif,
\t\t/images/cn_Columns.gif, \t\t\tRichFacesComponentsLibrary.html\#columns,
jbossrichfaces/freezone/docs/tlddoc/rich/columns.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcolumns.html,
\t\t\t\t\t/richfaces/columns.jsf
+fileUpload =richInputs, \t File Upload, \t\t/images/ico_FileUpload.gif,
\t\t/images/cn_FileUpload.gif,
\t\t\tRichFacesComponentsLibrary.html\#fileUpload,
jbossrichfaces/freezone/docs/tlddoc/rich/fileUpload.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIfileUpload.html,
\t\t\t\t\t/richfaces/fileUpload.jsf
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-26
13:34:11 UTC (rev 7256)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-26
14:00:15 UTC (rev 7257)
@@ -296,7 +296,7 @@
<managed-bean>
<managed-bean-name>fileUploadBean</managed-bean-name>
<managed-bean-class>org.richfaces.demo.fileUpload.FileUploadBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
<managed-bean-name>sortingBean</managed-bean-name>
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-03-26 13:34:11 UTC
(rev 7256)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/web.xml 2008-03-26 14:00:15 UTC
(rev 7257)
@@ -71,7 +71,7 @@
</init-param>
<init-param>
<param-name>maxRequestSize</param-name>
- <param-value>20000000</param-value>
+ <param-value>1000000</param-value>
</init-param>
</filter>
<filter-mapping>
Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_FileUpload.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/cn_FileUpload.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_PickList.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/cn_PickList.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ProgressBar.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ProgressBar.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_TableFiltering.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/cn_TableFiltering.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_TableSorting.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/cn_TableSorting.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/ico_FileUpload.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/ico_FileUpload.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/ico_TableFiltering.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/ico_TableFiltering.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/ico_TableSorting.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/ico_TableSorting.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/ico_pickList.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/ico_pickList.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/ico_progressBar.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/ico_progressBar.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
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-03-26
13:34:11 UTC (rev 7256)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/examples/fileUpload.xhtml 2008-03-26
14:00:15 UTC (rev 7257)
@@ -4,44 +4,55 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
-
+
<style>
- .top{
- vertical-align:top;
- }
- .info{
- height:210px;
- overflow:auto;
- }
- </style>
-
- <a4j:form>
- <a4j:keepAlive beanName="fileUploadBean" ajaxOnly="false"/>
+.top {
+ vertical-align: top;
+}
+
+.info {
+ height: 210px;
+ overflow: auto;
+}
+</style>
+
+ <h:form>
<h:panelGrid columns="2" columnClasses="top,top">
<rich:fileUpload fileUploadListener="#{fileUploadBean.listener}"
- maxFilesQuantity="5" reRender="table">
- <a4j:support event="onuploadcomplete"
reRender="table"></a4j:support>
+ maxFilesQuantity="#{fileUploadBean.uploadsAvailable}"
+ reRender="table" id="upload"
+ immediateUpload="#{fileUploadBean.autoUpload}"
+ acceptedTypes="jpg, gif, png, bmp">
+ <a4j:support event="onuploadcomplete" reRender="info" />
</rich:fileUpload>
-
- <rich:panel bodyClass="info" id="table">
- <f:facet name="header">
- <h:outputText value="Uploaded Files Info" />
- </f:facet>
- <h:outputText value="No files currently uploaded"
rendered="#{fileUploadBean.size==0}"></h:outputText>
- <rich:dataGrid columns="1" value="#{fileUploadBean.files}"
- var="file">
- <rich:panel>
- <h:panelGrid columns="2">
+ <h:panelGroup id="info">
+ <rich:panel bodyClass="info">
+ <f:facet name="header">
+ <h:outputText value="Uploaded Files Info" />
+ </f:facet>
+ <h:outputText value="No files currently uploaded"
+ rendered="#{fileUploadBean.size==0}" />
+ <rich:dataGrid columns="1" value="#{fileUploadBean.files}"
+ var="file" rowKeyVar="row">
+ <rich:panel>
<h:panelGrid columns="2">
- <h:outputText value="File Name:" />
- <h:outputText value="#{file.name}" />
- <h:outputText value="File Length(bytes):" />
- <h:outputText value="#{file.length}" />
+ <a4j:mediaOutput element="img" mimeType="image/jpeg"
+ createContent="#{fileUploadBean.paint}" value="#{row}"
+ style="width:50px; height:50px;" />
+ <h:panelGrid columns="2">
+ <h:outputText value="File Name:" />
+ <h:outputText value="#{file.name}" />
+ <h:outputText value="File Length(bytes):" />
+ <h:outputText value="#{file.length}" />
+ </h:panelGrid>
</h:panelGrid>
- </h:panelGrid>
- </rich:panel>
- </rich:dataGrid>
- </rich:panel>
+ </rich:panel>
+ </rich:dataGrid>
+ </rich:panel>
+ <a4j:commandButton action="#{fileUploadBean.clearUploadData}"
+ reRender="info, upload" value="Clear Uploaded Data"
+ rendered="#{fileUploadBean.size>0}" />
+ </h:panelGroup>
</h:panelGrid>
- </a4j:form>
+ </h:form>
</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml 2008-03-26
13:34:11 UTC (rev 7256)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml 2008-03-26
14:00:15 UTC (rev 7257)
@@ -8,8 +8,15 @@
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
+ <p><b>
+ rich:fileUpload</b> is a component which provides files upload functionality
and
+ extends functionality of standard <i>input </i>with
<i>type=file</i>.
+ </p>
<p>
- SHORT DESCRIPTION
+ Next example shows you <b>File Upload</b> which allows you to upload five
pictures to server.
+ Files count allowed to upload managed with <b>maxFilesQuantity
</b>attribute.
+ Every uploaded file should be managed through <b>fileUploadListener
</b>which called after
+ every single file upload finished.
</p>
<div class="sample-container" >
<ui:include src="/richfaces/fileUpload/examples/fileUpload.xhtml"/>
@@ -17,9 +24,42 @@
<ui:param name="sourcepath"
value="/richfaces/fileUpload/examples/fileUpload.xhtml"/>
</ui:include>
</div>
- <p>
- DESCRIPTION
- </p>
+ <fieldset>
+ <legend><b>Details of Usage</b></legend>
+ <p>
+ File upload could works in <b>automatic upload</b> mode. You should just
define
+ <b>immediateUpload </b>upload attribute as <b>true
</b>(<i>false by default</i>) and upload will be started
+ 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:"/>
+ <h:form>
+ <h:selectBooleanCheckbox value="#{fileUploadBean.autoUpload}">
+ <a4j:support event="onclick" reRender="upload"/>
+ </h:selectBooleanCheckbox>
+ </h:form>
+ <p>
+ In this example file types restricted to jpg, gif, png and bmp files using
<b>acceptedTypes </b>attribute.
+ </p>
+ <p>
+ FileUpload uses two init parameters which should be defined in Filter definition
+ in web.xml:
+ </p>
+ <ul>
+ <li>
+ <b>createTempFiles</b> boolean attribute which defines if the uploaded
files
+ will be stored in temporary files or available in listener just as byte[] data
+ (false for this example).
+ </li>
+ <li>
+ <b>maxRequestSize</b> attribute defines max size in bytes of the
uploaded files
+ (1000000 for this example).
+ </li>
+ </ul>
+ <p>
+
+ </p>
+ </fieldset>
</ui:define>
</ui:composition>