public abstract class AbstractFileUpload extends javax.faces.component.UIComponentBase implements AjaxProps, CoreProps, DisabledProps, EventsKeyProps, EventsMouseProps, I18nProps
The <rich:fileUpload> component allows the user to upload files to a server. It features multiple uploads, progress bars, restrictions on file types, and restrictions on sizes of the files to be uploaded.
Modifier and Type | Field and Description |
---|---|
static String |
COMPONENT_FAMILY |
static String |
COMPONENT_TYPE |
Constructor and Description |
---|
AbstractFileUpload() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsFile(UploadedFile file)
Checks whether this component can accept given
UploadedFile .. |
void |
addFileUploadListener(FileUploadListener listener)
Add a new
FileUploadListener to the set of listeners interested in being notified when
FileUploadEvent s occur. |
abstract String |
getAcceptedTypes()
Defines comma separated list of file extensions accepted by component.
|
List<String> |
getAcceptedTypesList()
Get a list of accepted types from
getAcceptedTypes() attribute. |
abstract String |
getAddLabel()
The label for the Add button.
|
abstract String |
getClearAllLabel()
The label for the Clear button.
|
abstract String |
getClearLabel()
The label displayed for the Clear link
|
abstract String |
getDeleteLabel()
The label displayed for the Delete link
|
abstract String |
getDoneLabel()
The label displayed when a file is successfully uploaded.
|
abstract javax.el.MethodExpression |
getFileUploadListener()
A listener function on the server side after each file is uploaded.
|
FileUploadListener[] |
getFileUploadListeners()
Return the set of registered
FileUploadListener s for this AbstractFileUpload instance. |
abstract String |
getListHeight()
Defines height of file list.
|
abstract Integer |
getMaxFilesQuantity()
Defines maximum number of files allowed to be uploaded.
|
abstract String |
getOnclear()
Javascript code executed when a file is cleared
|
abstract String |
getOnfileselect()
Javascript code executed when a file is selected
|
abstract String |
getOnfilesubmit()
Javascript code executed when a file is submitted
|
abstract String |
getOntyperejected()
Javascript code executed when a file does not meet the conditions stated by acceptedTypes parameter.
|
abstract String |
getOnuploadcomplete()
Javascript code executed when a file upload is complete
|
abstract String |
getServerErrorLabel()
The label displayed when a file upload fails due to a server error.
|
abstract String |
getSizeExceededLabel()
The label displayed when a file exceeds the size limit.
|
abstract String |
getUploadLabel()
The label for the Upload button.
|
abstract boolean |
isImmediateUpload()
If "true" upload stats immediately after file selection
|
abstract boolean |
isNoDuplicate()
If "true" duplicate file uploads are prevented
|
void |
processEvent(javax.faces.event.ComponentSystemEvent event) |
void |
queueEvent(javax.faces.event.FacesEvent event)
Increments number of
FileUploadEvent which were queued |
void |
removeFileUploadListener(FileUploadListener listener)
Remove an existing
FileUploadListener (if any) from the set of listeners interested in being notified when
FileUploadListener s occur. |
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getFamily, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getData, getExecute, getOnbeforedomupdate, getOnbegin, getOncomplete, getRender, getStatus, isLimitRender
getStyle, getStyleClass, getTitle
isDisabled
getOnkeydown, getOnkeypress, getOnkeyup
getOnclick, getOndblclick, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup
public static final String COMPONENT_TYPE
public static final String COMPONENT_FAMILY
public abstract String getAcceptedTypes()
public abstract Integer getMaxFilesQuantity()
public abstract boolean isNoDuplicate()
If "true" duplicate file uploads are prevented
Default is "false"
public abstract boolean isImmediateUpload()
If "true" upload stats immediately after file selection
Default is "false"
public abstract String getOnfileselect()
public abstract String getOnfilesubmit()
public abstract String getOntyperejected()
public abstract String getOnuploadcomplete()
public abstract String getOnclear()
public abstract String getAddLabel()
public abstract String getUploadLabel()
public abstract String getClearAllLabel()
public abstract String getDoneLabel()
public abstract String getSizeExceededLabel()
public abstract String getServerErrorLabel()
public abstract String getClearLabel()
public abstract String getDeleteLabel()
public abstract String getListHeight()
Defines height of file list.
Default value is "210px".
public void processEvent(javax.faces.event.ComponentSystemEvent event) throws javax.faces.event.AbortProcessingException
processEvent
in interface javax.faces.event.ComponentSystemEventListener
processEvent
in class javax.faces.component.UIComponent
javax.faces.event.AbortProcessingException
public abstract javax.el.MethodExpression getFileUploadListener()
public void addFileUploadListener(FileUploadListener listener)
Add a new FileUploadListener
to the set of listeners interested in being notified when
FileUploadEvent
s occur.
listener
- The FileUploadListener
to be addedNullPointerException
- if listener
is null
public FileUploadListener[] getFileUploadListeners()
Return the set of registered FileUploadListener
s for this AbstractFileUpload
instance. If there are no
registered listeners, a zero-length array is returned.
public void removeFileUploadListener(FileUploadListener listener)
Remove an existing FileUploadListener
(if any) from the set of listeners interested in being notified when
FileUploadListener
s occur.
listener
- The FileUploadListener
to be removedNullPointerException
- if listener
is null
public List<String> getAcceptedTypesList()
getAcceptedTypes()
attribute.public boolean acceptsFile(UploadedFile file)
UploadedFile
..
First, the number of enqueued FileUploadEvent
events can't exceed getMaxFilesQuantity()
.
Then, the file extension of uploaded file needs to be acceptable by this component (see getAcceptedTypes()
).public void queueEvent(javax.faces.event.FacesEvent event)
FileUploadEvent
which were queuedqueueEvent
in class javax.faces.component.UIComponentBase
Copyright © 2014 JBoss by Red Hat. All Rights Reserved.