|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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<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.
FILE UPLOADS ARE NOT SUPPORTED BY AJAX. USE GOOGLE TO LEARN MORE ABOUT THIS.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.wicket.markup.html.form.FormComponent |
|---|
FormComponent.AbstractVisitor, FormComponent.IVisitor |
| Nested classes/interfaces inherited from class org.apache.wicket.Component |
|---|
Component.ComponentModelChange, Component.EnabledChange, Component.VisibilityChange |
| 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_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED6, FLAG_RESERVED7, FLAG_RESERVED8, PATH_SEPARATOR, RENDER |
| Constructor Summary | |
|---|---|
FileUploadField(java.lang.String id)
|
|
FileUploadField(java.lang.String id,
IModel<FileUpload> model)
|
|
| Method Summary | |
|---|---|
protected FileUpload |
convertValue(java.lang.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()
|
java.lang.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. |
FileUploadField |
setDefaultModel(IModel<?> model)
Sets the given model. |
protected boolean |
supportsPersistence()
FileInputs cannot be persisted; returns false. |
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, getForm, getInput, getInputName, getModel, getModelObject, getModelValue, getRawInput, getType, getValidatorKeyPrefix, getValidators, getValue, hasRawInput, inputAsInt, inputAsInt, inputAsIntArray, inputChanged, internalOnModelChanged, invalid, isInputNullable, isPersistent, isRequired, isValid, newValidatable, onDisabled, onInvalid, onValid, processChildren, processInput, setConvertedInput, setLabel, setModel, setModelObject, setModelValue, setModelValue, setPersistent, setRequired, setType, shouldTrimInput, trim, valid, validate, validateRequired, validateValidators, visitComponentsPostOrder, visitFormComponentsPostOrder |
| Methods inherited from class org.apache.wicket.markup.html.form.LabeledWebMarkupContainer |
|---|
getLabel, setLabelInternal |
| Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer |
|---|
getMarkupType, getWebPage, getWebRequest |
| Methods inherited from class org.apache.wicket.MarkupContainer |
|---|
add, addOrReplace, autoAdd, autoAdd, contains, findMarkupStream, get, get, getAssociatedMarkupStream, getMarkupStream, hasAssociatedMarkup, internalAdd, isTransparentResolver, iterator, iterator, newMarkupResourceStream, onComponentTagBody, onRender, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderComponentTagBody, replace, setMarkupStream, size, swap, toString, toString, visitChildren, visitChildren |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FileUploadField(java.lang.String id)
Component.Component(String)
public FileUploadField(java.lang.String id,
IModel<FileUpload> model)
id - See Componentmodel - See Component| Method Detail |
|---|
public FileUpload getFileUpload()
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<FileUpload>FormComponent.updateModel()public FileUploadField setDefaultModel(IModel<?> model)
ComponentWARNING: DO NOT OVERRIDE THIS METHOD UNLESS YOU HAVE A VERY GOOD REASON FOR IT. OVERRIDING THIS MIGHT OPEN UP SECURITY LEAKS AND BREAK BACK-BUTTON SUPPORT.
setDefaultModel in class MarkupContainermodel - The model
Component.setDefaultModel(org.apache.wicket.model.IModel)public java.lang.String[] getInputAsArray()
FormComponent
getInputAsArray in class FormComponent<FileUpload>FormComponent.getInputAsArray()
protected FileUpload convertValue(java.lang.String[] value)
throws ConversionException
FormComponentIConverter. WARNING: this method may be removed in future versions.
If conversion fails then a ConversionException should be thrown
convertValue in class FormComponent<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<FileUpload>FormComponent.isMultiPart()protected void onComponentTag(ComponentTag tag)
FormComponent
onComponentTag in class FormComponent<FileUpload>tag - Tag to modifyComponent.onComponentTag(org.apache.wicket.markup.ComponentTag)protected boolean supportsPersistence()
supportsPersistence in class FormComponent<FileUpload>FormComponent.supportsPersistence()protected void onDetach()
onDetach in class FormComponent<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 | |||||||||