public class FileUploadField extends Component implements IsField<String>
FormPanel.setEncoding(Encoding)
. In addition, the method should be set to POST using
FormPanel.setMethod(Method)
You must set a name for uploads to work with Firefox.Modifier and Type | Class and Description |
---|---|
protected class |
FileUploadField.DefaultFileUploadFieldMessages |
static interface |
FileUploadField.FileUploadFieldAppearance |
static interface |
FileUploadField.FileUploadFieldMessages |
adjustSize, allowTextSelection, cacheSizes, disableContextMenu, disabled, disabledStyle, ensureVisibilityOnSizing, height, hidden, lastSize, layer, left, mask, maskMessage, monitorWindowResize, pageX, pageY, resizeHandler, shim, tabIndex, toolTip, toolTipConfig, top, width, windowResizeDelay, windowResizeTask
Constructor and Description |
---|
FileUploadField()
Creates a new file upload field.
|
FileUploadField(FileUploadField.FileUploadFieldAppearance appearance)
Creates a new file upload field.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addChangeHandler(ChangeHandler handler) |
HandlerRegistration |
addValueChangeHandler(<any> valueChangeHandler) |
void |
clear()
Clears the value from the field.
|
void |
clearInvalid()
Clear any invalid styles / messages for this field.
|
protected void |
createFileInput() |
protected void |
doAttachChildren() |
protected void |
doDetachChildren() |
void |
finishEditing()
Used to indicate that this field must be completed with its editing process, as it may be able to be removed from
the dom, hidden, or its current results used.
|
FileUploadField.FileUploadFieldAppearance |
getAppearance() |
List<EditorError> |
getErrors()
Returns a list of the current errors.
|
protected InputElement |
getFileInput()
Returns the file input element.
|
protected XElement |
getFocusEl() |
FileUploadField.FileUploadFieldMessages |
getMessages()
Returns the file upload field messages.
|
String |
getName() |
String |
getValue() |
boolean |
isAllowBlank()
Returns the field's allow blank state.
|
boolean |
isReadOnly()
Returns the read only state.
|
boolean |
isValid()
Returns whether or not the field value is currently valid.
|
boolean |
isValid(boolean preventMark)
Returns whether or not the field value is currently valid.
|
protected void |
onAfterFirstAttach()
Called immediately after the first time the widget becomes attached to the browser's document only the first time.
|
protected void |
onBlur(Event event) |
void |
onBrowserEvent(Event event) |
protected void |
onChange(Event event) |
protected void |
onResize(int width,
int height)
Called after the widget is resized, this method is empty by default but can be implemented by any subclass that
needs to perform custom logic after a resize occurs.
|
void |
reset()
Resets the current field value to the originally loaded value and clears any validation messages.
|
protected void |
resizeFile() |
void |
setAllowBlank(boolean allowBlank)
Sets whether a field is valid when its value length = 0 (default to true).
|
void |
setEnabled(boolean enabled)
Convenience function for setting disabled/enabled by boolean.
|
void |
setMessages(FileUploadField.FileUploadFieldMessages messages)
Sets the file upload field messages.
|
void |
setName(String name) |
void |
setReadOnly(boolean readonly)
Sets the field's read only state.
|
void |
setValue(String value) |
boolean |
validate(boolean preventMark)
Validates the field value.
|
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleDependentName, addStyleOnOver, adjustPosition, adjustSize, applyState, assertAfterRender, assertPreRender, blur, clearSizeCache, disable, disableContextMenu, disableEvents, enable, enableEvents, fireCancellableEvent, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getPositionEl, getShadow, getShadowPosition, getStateId, getTabIndex, getToolTip, hide, hideShadow, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, notifyHide, notifyShow, onAttach, onDetach, onDisable, onEnable, onFocus, onHide, onHideContextMenu, onLoad, onPosition, onRightClick, onShow, onShowContextMenu, onUnload, onWindowResize, removeStyleDependentName, removeStyleOnOver, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setHeight, setHeight, setHideMode, setId, setItemId, setMonitorWindowResize, setPagePosition, setPixelSize, setPosition, setShadow, setShadowPosition, setSize, setStateful, setStateId, setStyleDependentName, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBlurHandler
public FileUploadField()
public FileUploadField(FileUploadField.FileUploadFieldAppearance appearance)
appearance
- the appearancepublic HandlerRegistration addChangeHandler(ChangeHandler handler)
public HandlerRegistration addValueChangeHandler(<any> valueChangeHandler)
public void clear()
IsField
clear
in interface IsField<String>
to remove validation messages
,
to restore to original value and remove validation messages
public void clearInvalid()
IsField
clearInvalid
in interface IsField<String>
public void finishEditing()
IsField
finishEditing
in interface IsField<String>
public FileUploadField.FileUploadFieldAppearance getAppearance()
public List<EditorError> getErrors()
IsField
public FileUploadField.FileUploadFieldMessages getMessages()
public String getName()
public String getValue()
public boolean isAllowBlank()
public boolean isReadOnly()
public boolean isValid()
public boolean isValid(boolean preventMark)
IsField
public void onBrowserEvent(Event event)
onBrowserEvent
in class Component
public void reset()
IsField
public void setAllowBlank(boolean allowBlank)
allowBlank
- true to allow blanks, false otherwisepublic void setEnabled(boolean enabled)
setEnabled
in class Component
enabled
- the enabled statepublic void setMessages(FileUploadField.FileUploadFieldMessages messages)
messages
- the messagespublic void setName(String name)
public void setReadOnly(boolean readonly)
readonly
- the read only statepublic void setValue(String value)
public boolean validate(boolean preventMark)
IsField
protected void createFileInput()
protected void doAttachChildren()
protected void doDetachChildren()
protected InputElement getFileInput()
protected XElement getFocusEl()
getFocusEl
in class Component
protected void onAfterFirstAttach()
Component
onAfterFirstAttach
in class Component
protected void onChange(Event event)
protected void onResize(int width, int height)
Component
protected void resizeFile()
Copyright © 2018. All rights reserved.