com.sencha.gxt.widget.core.client.form
Class FileUploadField

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.form.FileUploadField
All Implemented Interfaces:
Editor<java.lang.String>, LeafValueEditor<java.lang.String>, HasChangeHandlers, HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, TakesValue<java.lang.String>, HasEnabled, HasName, HasVisibility, IsWidget, BeforeHideEvent.HasBeforeHideHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MoveEvent.HasMoveHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, IsField<java.lang.String>, HasFocusSupport, HasItemId

public class FileUploadField
extends Component
implements IsField<java.lang.String>, HasChangeHandlers, HasName

A file upload field. When using this field, the containing form panel's encoding must be set to MULTIPART using 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.


Nested Class Summary
static interface FileUploadField.FileUploadFieldAppearance
           
static interface FileUploadField.FileUploadFieldMessages
           
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.editor.client.Editor
Editor.Ignore, Editor.Path
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
FileUploadField()
          Creates a new file upload field.
FileUploadField(FileUploadField.FileUploadFieldAppearance appearance)
          Creates a new file upload field.
 
Method Summary
 HandlerRegistration addChangeHandler(ChangeHandler handler)
           
 void clear()
          Clears the value from the field.
 void clearInvalid()
          Clear any invalid styles / messages for this field.
 FileUploadField.FileUploadFieldMessages getMessages()
          Returns the file upload field messages.
 java.lang.String getName()
           
 java.lang.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.
 void onBrowserEvent(Event event)
           
 void reset()
          Resets the current field value to the originally loaded value and clears any validation messages.
 void setAllowBlank(boolean allowBlank)
          Sets whether a field is valid when its value length = 0 (default to true).
 void setMessages(FileUploadField.FileUploadFieldMessages messages)
          Sets the file upload field messages.
 void setName(java.lang.String name)
           
 void setReadOnly(boolean readonly)
          Sets the field's read only state.
 void setValue(java.lang.String value)
           
 boolean validate(boolean preventMark)
          Validates the field value.
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disable, disableEvents, enable, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.user.client.ui.IsWidget
asWidget
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

FileUploadField

public FileUploadField()
Creates a new file upload field.


FileUploadField

public FileUploadField(FileUploadField.FileUploadFieldAppearance appearance)
Creates a new file upload field.

Parameters:
appearance - the appearance
Method Detail

addChangeHandler

public HandlerRegistration addChangeHandler(ChangeHandler handler)
Specified by:
addChangeHandler in interface HasChangeHandlers

clear

public void clear()
Description copied from interface: IsField
Clears the value from the field.

Specified by:
clear in interface IsField<java.lang.String>

clearInvalid

public void clearInvalid()
Description copied from interface: IsField
Clear any invalid styles / messages for this field.

Specified by:
clearInvalid in interface IsField<java.lang.String>

getMessages

public FileUploadField.FileUploadFieldMessages getMessages()
Returns the file upload field messages.

Returns:
the messages

getName

public java.lang.String getName()
Specified by:
getName in interface HasName

getValue

public java.lang.String getValue()
Specified by:
getValue in interface TakesValue<java.lang.String>

isAllowBlank

public boolean isAllowBlank()
Returns the field's allow blank state.

Returns:
true if blank values are allowed

isReadOnly

public boolean isReadOnly()
Returns the read only state.

Returns:
true if read only, otherwise false

isValid

public boolean isValid()
Returns whether or not the field value is currently valid.

Returns:
true if the value is valid, otherwise false

isValid

public boolean isValid(boolean preventMark)
Description copied from interface: IsField
Returns whether or not the field value is currently valid.

Specified by:
isValid in interface IsField<java.lang.String>
Parameters:
preventMark - true for silent validation (no invalid event and field is not marked invalid)
Returns:
true if the value is valid, otherwise false

onBrowserEvent

public void onBrowserEvent(Event event)
Specified by:
onBrowserEvent in interface EventListener
Overrides:
onBrowserEvent in class Component

reset

public void reset()
Description copied from interface: IsField
Resets the current field value to the originally loaded value and clears any validation messages.

Specified by:
reset in interface IsField<java.lang.String>

setAllowBlank

public void setAllowBlank(boolean allowBlank)
Sets whether a field is valid when its value length = 0 (default to true).

Parameters:
allowBlank - true to allow blanks, false otherwise

setMessages

public void setMessages(FileUploadField.FileUploadFieldMessages messages)
Sets the file upload field messages.

Parameters:
messages - the messages

setName

public void setName(java.lang.String name)
Specified by:
setName in interface HasName

setReadOnly

public void setReadOnly(boolean readonly)
Sets the field's read only state.

Parameters:
readonly - the read only state

setValue

public void setValue(java.lang.String value)
Specified by:
setValue in interface TakesValue<java.lang.String>

validate

public boolean validate(boolean preventMark)
Description copied from interface: IsField
Validates the field value.

Specified by:
validate in interface IsField<java.lang.String>
Parameters:
preventMark - true to not mark the field valid and fire invalid event when invalid
Returns:
true if valid, otherwise false


Copyright © 2012. All Rights Reserved.