|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.domui.dom.css.CssBase
to.etc.domui.dom.html.NodeBase
to.etc.domui.dom.html.NodeContainer
to.etc.domui.dom.html.Div
to.etc.domui.component.upload.FileUpload
public class FileUpload
Represents a file upload thingy which handles ajaxy uploads. The basic model is as follows:
In the browser the primary upload thingy is an input type='file' component. This gets used to allow the user to add a file. As soon as a file is selected an onchange event will ensure the posting of the file to the server using an AJAX/IFrame upload. This upload will be received by the Upload part which will attach the file to the control doing the upload. When the upload is complete the input type="file" thing gets replaced by a "file reference" containing the input filename and a delete button. If the input thingy allows for multiple files to be uploaded another input type="file" gets added above that.
Constructor Summary | |
---|---|
FileUpload()
|
|
FileUpload(int maxfiles,
java.lang.String allowedExt)
Create an upload item that acceps a max #of files and a set of extensions. |
Method Summary | |
---|---|
void |
createContent()
|
java.lang.String |
getAllowedExtensions()
Return the space separated list of allowed file extensions. |
java.util.List<UploadItem> |
getFiles()
Return the current value: the list of files that have been uploaded and their related data. |
int |
getMaxFiles()
|
boolean |
isFull()
Return T if the max. |
boolean |
isRequired()
FIXME T if at least 1 file needs to be uploaded. |
void |
removeUploadItem(UploadItem ufi)
Removes specified upload item. |
void |
setAllowedExtensions(java.lang.String allowedExtensions)
Set the list of allowed file extensions. |
void |
setMaxFiles(int maxFiles)
|
void |
setRequired(boolean required)
Set to T if at least one file needs to have been uploaded. |
Methods inherited from class to.etc.domui.dom.html.Div |
---|
afterCreateContent, componentHandleWebAction, fadeIn, fadeIn, fadeOut, getDragHandler, getDropBody, getDropHandler, getDropMode, getReturnPressed, setDragHandler, setDropBody, setDropHandler, setReturnPressed, slideDown, slideUp, tb, visit |
Methods inherited from class to.etc.domui.dom.html.NodeContainer |
---|
add, add, add, addTable, canContain, delegateTo, findChildIndex, forceRebuild, getChild, getChildCount, getChildren, getDeepChild, getDeepChildren, getErrorFence, internalCheckNotDirty, internalClearDelta, internalClearDeltaFully, internalGetOldChildren, internalShelve, internalUnshelve, iterator, moveControlToModel, moveModelToControl, onRefresh, removeAllChildren, removeChild, removeChild, replaceChild, setControlsEnabled, setErrorFence, setErrorFence, setText, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FileUpload()
public FileUpload(int maxfiles, java.lang.String allowedExt)
maxfiles
- allowedExt
- Method Detail |
---|
public void createContent() throws java.lang.Exception
createContent
in class NodeBase
java.lang.Exception
public java.util.List<UploadItem> getFiles()
UploadItem
contains a reference to the
actual file UploadItem.getFile()
; this file remains present only
while the page is still alive. If the page is destroyed all of it's uploaded
files will be deleted. So if you need to retain the file somehow after upload
it's contents needs to be copied to either another file that you control
or to a BLOB in a database.
public boolean isFull()
public void removeUploadItem(UploadItem ufi)
ufi
- public java.lang.String getAllowedExtensions()
public void setAllowedExtensions(java.lang.String allowedExtensions)
allowedExtensions
- public boolean isRequired()
public void setRequired(boolean required)
required
- public int getMaxFiles()
public void setMaxFiles(int maxFiles)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |