|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.component.UIComponent javax.faces.component.UIComponentBase javax.faces.component.UIOutput javax.faces.component.UIInput javax.faces.component.html.HtmlInputText org.apache.myfaces.custom.fileupload.AbstractHtmlInputFileUpload
public abstract class AbstractHtmlInputFileUpload
Creates a file-selection widget in the rendered page which allows a user to select a file for uploading to the server.
When the page is selected (using a command component such as commandButton), the currently selected file contents are included in the data posted to the server. The contents are cached somewhere, and an object of type UploadedFile will then be assigned to the property pointed to by the "value" expression of this component.
You must enable the Tomahawk ExtensionsFilter to make this component work (see web.xml).
Also, don't forget to set the form's attribute "enctype" to "multipart/form-data". See "examples/web/fileupload.jsp" for an example!
Unless otherwise specified, all attributes accept static values or EL expressions.
Field Summary | |
---|---|
static String |
COMPONENT_TYPE
|
static String |
DEFAULT_RENDERER_TYPE
|
static String |
SIZE_LIMIT_MESSAGE_ID
|
Fields inherited from class javax.faces.component.UIInput |
---|
COMPONENT_FAMILY, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID |
Fields inherited from interface org.apache.myfaces.component.UserRoleAware |
---|
ENABLED_ON_USER_ROLE_ATTR, VISIBLE_ON_USER_ROLE_ATTR |
Constructor Summary | |
---|---|
AbstractHtmlInputFileUpload()
|
Method Summary | |
---|---|
abstract String |
getAccept()
This attribute specifies a comma-separated list of content types that a server processing this form will handle correctly. |
abstract String |
getStorage()
This setting was intended to allow control over how the contents of the file get temporarily stored during processing. |
UploadedFile |
getUploadedFile()
|
Object |
getValue()
An EL expression to which an UploadedFile object will be assigned on postback if the user specified a file to upload to the server. |
boolean |
isRendered()
|
void |
setUploadedFile(UploadedFile upFile)
|
protected void |
validateValue(javax.faces.context.FacesContext context,
Object convertedValue)
|
Methods inherited from class javax.faces.component.html.HtmlInputText |
---|
getAccesskey, getAlt, getDir, getLang, getMaxlength, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getSize, getStyle, getStyleClass, getTabindex, getTitle, isDisabled, isReadonly, restoreState, saveState, setAccesskey, setAlt, setDir, setDisabled, setLang, setMaxlength, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setReadonly, setSize, setStyle, setStyleClass, setTabindex, setTitle |
Methods inherited from class javax.faces.component.UIInput |
---|
addValidator, addValueChangeListener, broadcast, compareValues, decode, getConvertedValue, getFamily, getSubmittedValue, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, setValue, setValueChangeListener, updateModel, validate |
Methods inherited from class javax.faces.component.UIOutput |
---|
getConverter, getLocalValue, setConverter |
Methods inherited from class javax.faces.component.UIComponentBase |
---|
addFacesListener, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.myfaces.component.UserRoleAware |
---|
getEnabledOnUserRole, getVisibleOnUserRole, setEnabledOnUserRole, setVisibleOnUserRole |
Methods inherited from interface org.apache.myfaces.component.AlignProperty |
---|
getAlign |
Methods inherited from interface javax.faces.component.ValueHolder |
---|
getConverter, getLocalValue, setConverter |
Field Detail |
---|
public static final String COMPONENT_TYPE
public static final String DEFAULT_RENDERER_TYPE
public static final String SIZE_LIMIT_MESSAGE_ID
Constructor Detail |
---|
public AbstractHtmlInputFileUpload()
Method Detail |
---|
public void setUploadedFile(UploadedFile upFile)
public UploadedFile getUploadedFile()
public abstract String getStorage()
It allows three options
public abstract String getAccept()
public Object getValue()
getValue
in interface javax.faces.component.ValueHolder
getValue
in class javax.faces.component.UIInput
public boolean isRendered()
isRendered
in class javax.faces.component.UIComponentBase
protected void validateValue(javax.faces.context.FacesContext context, Object convertedValue)
validateValue
in class javax.faces.component.UIInput
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |