public class FileUploadField extends FormComponent<List<FileUpload>>
Form, that has multipart ==
true, its model is updated with the FileUpload
for this component.
NOTEThe model of this component is reset with null at the end of the
request because FileUpload instances do not survive across requests since the input
streams they point to will be closed. Because of this, the FileUpload instance should be
processed within the same request as the form containing it was submitted.
FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL, VALUE_SEPARATORENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING| Constructor and Description |
|---|
FileUploadField(String id) |
FileUploadField(String id,
IModel<List<FileUpload>> model) |
| Modifier and Type | Method and Description |
|---|---|
protected List<FileUpload> |
convertValue(String[] value)
Subclasses should overwrite this if the conversion is not done through the type field and the
IConverter. |
protected boolean |
forceCloseStreamsOnDetach()
The FileUploadField will close any input streams you have opened in its FileUpload by
default.
|
FileUpload |
getFileUpload() |
List<FileUpload> |
getFileUploads() |
String[] |
getInputAsArray()
Gets the request parameters for this component as strings.
|
boolean |
isMultiPart() |
protected void |
onComponentTag(ComponentTag tag)
Processes the component tag.
|
protected void |
onDetach()
Clean up at the end of the request.
|
void |
updateModel()
Updates this components model from the request, it expects that the object is already
converted through the convertInput() call that is called by the validate() method when a form
is being processed.
|
add, add, checkRequired, clearInput, convertInput, error, getConvertedInput, getDefaultLabel, getDefaultLabel, getForm, getInput, getInputName, getModel, getModelObject, getModelValue, getRawInput, getType, getValidatorKeyPrefix, getValidators, getValue, hasRawInput, inputAsInt, inputAsInt, inputAsIntArray, inputChanged, internalOnModelChanged, invalid, isInputNullable, isRequired, isValid, newValidatable, newValidationError, onDisabled, onInvalid, onRequired, onValid, processChildren, processInput, remove, reportRequiredError, setConvertedInput, setLabel, setModel, setModelObject, setModelValue, setRequired, setType, shouldTrimInput, trim, updateAutoLabels, updateCollectionModel, valid, validate, validateRequired, validateValidators, visitComponentsPostOrder, visitFormComponentsPostOrdergetLabelgetWebPage, getWebRequest, getWebResponse, getWebSessionadd, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, findComponentToDequeue, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onAfterRenderChildren, onComponentTagBody, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildrenadd, addStateChange, afterRender, beforeRender, canCallListenerInterface, canCallListenerInterfaceAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalPrepareForRender, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isRenderAllowed, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onBeforeRender, onConfigure, onEvent, onModelChanged, onModelChanging, onRemove, prepareForRender, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderHead, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setRequestFlag, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlFor, urlFor, visitParents, visitParents, warn, wrappublic FileUploadField(String id)
Component.Component(String)public FileUploadField(String id, IModel<List<FileUpload>> model)
id - See Componentmodel - the model holding the uploaded FileUploadspublic FileUpload getFileUpload()
getFileUploads()public List<FileUpload> getFileUploads()
public void updateModel()
FormComponentsetModelObject(getConvertedInput());DO NOT CALL THIS METHOD DIRECTLY UNLESS YOU ARE SURE WHAT YOU ARE DOING. USUALLY UPDATING YOUR MODEL IS HANDLED BY THE FORM, NOT DIRECTLY BY YOU.
updateModel in interface IFormModelUpdateListenerupdateModel in class FormComponent<List<FileUpload>>FormComponent.updateModel()public String[] getInputAsArray()
FormComponentgetInputAsArray in class FormComponent<List<FileUpload>>FormComponent.getInputAsArray()protected List<FileUpload> convertValue(String[] value) throws ConversionException
FormComponentIConverter. WARNING: this method may be removed in future versions.
If conversion fails then a ConversionException should be thrownconvertValue in class FormComponent<List<FileUpload>>value - The value can be the getInput() or through a cookieConversionException - If input can't be convertedFormComponent.convertValue(java.lang.String[])public boolean isMultiPart()
isMultiPart in class FormComponent<List<FileUpload>>FormComponent.isMultiPart()protected void onComponentTag(ComponentTag tag)
FormComponentonComponentTag in class FormComponent<List<FileUpload>>tag - Tag to modifyComponent.onComponentTag(org.apache.wicket.markup.ComponentTag)protected void onDetach()
onDetach in class FormComponent<List<FileUpload>>Component.onDetach()protected boolean forceCloseStreamsOnDetach()
true if stream should be closed at the end of requestCopyright © 2006–2014 Apache Software Foundation. All rights reserved.