|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.Component org.apache.wicket.MarkupContainer org.apache.wicket.markup.html.WebMarkupContainer org.apache.wicket.markup.html.form.LabeledWebMarkupContainer org.apache.wicket.markup.html.form.FormComponent<List<FileUpload>> org.apache.wicket.markup.html.form.upload.FileUploadField
public class FileUploadField
Form component that corresponds to a <input type="file">. When a FileInput
component is nested in a 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.
Field Summary |
---|
Fields inherited from class org.apache.wicket.markup.html.form.FormComponent |
---|
FLAG_CONVERT_EMPTY_INPUT_STRING_TO_NULL, VALUE_SEPARATOR |
Fields inherited from class org.apache.wicket.Component |
---|
ENABLE, FLAG_INITIALIZED, FLAG_REMOVING_FROM_HIERARCHY, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER |
Constructor Summary | |
---|---|
FileUploadField(String id)
|
|
FileUploadField(String id,
IModel<List<FileUpload>> model)
|
Method Summary | |
---|---|
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. |
Methods inherited from class org.apache.wicket.markup.html.form.FormComponent |
---|
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, visitFormComponentsPostOrder |
Methods inherited from class org.apache.wicket.markup.html.form.LabeledWebMarkupContainer |
---|
getLabel |
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
---|
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession |
Methods inherited from class org.apache.wicket.MarkupContainer |
---|
add, addOrReplace, autoAdd, contains, get, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, onAfterRenderChildren, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, swap, toString, toString, visitChildren, visitChildren, visitChildren, visitChildren |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FileUploadField(String id)
Component.Component(String)
public FileUploadField(String id, IModel<List<FileUpload>> model)
id
- See Componentmodel
- the model holding the uploaded FileUpload
sMethod Detail |
---|
public FileUpload getFileUpload()
getFileUploads()
public List<FileUpload> getFileUploads()
public void updateModel()
FormComponent
setModelObject(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 IFormModelUpdateListener
updateModel
in class FormComponent<List<FileUpload>>
FormComponent.updateModel()
public String[] getInputAsArray()
FormComponent
getInputAsArray
in class FormComponent<List<FileUpload>>
FormComponent.getInputAsArray()
protected List<FileUpload> convertValue(String[] value) throws ConversionException
FormComponent
IConverter
. WARNING: this method may be removed in future versions.
If conversion fails then a ConversionException should be thrown
convertValue
in class FormComponent<List<FileUpload>>
value
- The value can be the getInput() or through a cookie
ConversionException
- 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)
FormComponent
onComponentTag
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 request
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |