com.extjs.gxt.ui.client.widget.form
Class MultiField<D>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.extjs.gxt.ui.client.widget.Component
              extended by com.extjs.gxt.ui.client.widget.BoxComponent
                  extended by com.extjs.gxt.ui.client.widget.form.Field<D>
                      extended by com.extjs.gxt.ui.client.widget.form.MultiField<D>
All Implemented Interfaces:
Observable, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget
Direct Known Subclasses:
CheckBoxGroup, DualListField, RadioGroup

public class MultiField<D>
extends Field<D>

A field that displays multiple fields in a single row or column.

Inherited Events:
Field Focus
Field Blur
Field Change
Field Invalid
Field Valid
Field KeyPress
Field SpecialKey
BoxComponent Move
BoxComponent Resize
Component Enable
Component Disable
Component BeforeHide
Component Hide
Component BeforeShow
Component Show
Component Attach
Component Detach
Component BeforeRender
Component Render
Component BrowserEvent
Component BeforeStateRestore
Component StateRestore
Component BeforeStateSave
Component SaveState


Nested Class Summary
 
Nested classes/interfaces inherited from class com.extjs.gxt.ui.client.widget.form.Field
Field.FieldImages, Field.FieldMessages
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
protected  java.util.List<Field<?>> fields
           
protected  LayoutContainer lc
           
protected  Style.Orientation orientation
           
protected  int spacing
           
protected  Validator validator
           
 
Fields inherited from class com.extjs.gxt.ui.client.widget.form.Field
autoValidate, emptyText, errorIcon, fieldStyle, focusStyle, focusValue, forceInvalidText, hasFocus, images, invalidStyle, messages, name, originalValue, preventMark, propertyEditor, readOnly, readOnlyFieldStyle, validationDelay, validationTask, value
 
Fields inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustSize, cacheSizes, ensureVisibilityOnSizing, height, lastSize, layer, shim, width
 
Fields inherited from class com.extjs.gxt.ui.client.widget.Component
afterRender, attachables, baseStyle, disabled, disabledStyle, disableTextSelection, dummy, focusable, hidden, mask, maskMessage, maskMessageStyleName, monitorWindowResize, rendered, resizeHandler, setElementRender, stateId, swallowEvents, toolTip, windowResizeDelay, windowResizeTask
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
MultiField()
          Creates a new multi-field.
MultiField(java.lang.String fieldLabel, Field<?>... fields)
          Creates a new multi-field.
 
Method Summary
 void add(Field<?> field)
          Adds a field (pre-render).
 void clear()
          Clears the value from the field.
protected  void doAttachChildren()
           
protected  void doDetachChildren()
           
 Field<?> get(int index)
          Returns the field at the index.
 java.util.List<Field<?>> getAll()
          Returns all the child field's.
protected  El getInputEl()
          Provides support for wrapping the actual input element.
 Style.Orientation getOrientation()
          Returns the fields orientation.
 int getSpacing()
          Returns the field's spacing.
 Validator getValidator()
          Returns the field's validator.
 boolean isResizeFields()
          Returns true if child fields are being resized.
 boolean isValid(boolean silent)
          Returns whether or not the field value is currently valid.
protected  void notifyHide()
           
protected  void notifyShow()
           
 void onBrowserEvent(com.google.gwt.user.client.Event event)
          Components delegate event handling to Component.onComponentEvent(ComponentEvent).
 void onComponentEvent(ComponentEvent ce)
          Any events a component receives will be forwarded to this method.
protected  void onDisable()
           
protected  void onEnable()
           
protected  void onRender(com.google.gwt.user.client.Element target, int index)
          Subclasses must override and ensure setElement is called for lazy rendered components.
protected  void onResize(int width, int height)
          Called after the component 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.
 void setOrientation(Style.Orientation orientation)
          Sets the fields orientation (defaults to horizontal).
 void setReadOnly(boolean readOnly)
          Sets the field's read only state.
 void setResizeFields(boolean resizeFields)
          True to resize the child fields to fit available space (defaults to false).
 void setSpacing(int spacing)
          Sets the amount of spacing between fields.
 void setValidator(Validator validator)
          Sets the field's validator.
protected  boolean validateValue(java.lang.String value)
          Subclasses should provide the validation implementation by overriding this.
 
Methods inherited from class com.extjs.gxt.ui.client.widget.form.Field
addInputStyleName, addKeyListener, afterRender, alignErrorIcon, clearInvalid, createComponentEvent, findLabelElement, fireChangeEvent, fireKey, focus, forceInvalid, getAutoValidate, getEmptyText, getErrorMessage, getFieldLabel, getImages, getLabelSeparator, getLabelStyle, getMessages, getMessageTarget, getName, getOriginalValue, getPropertyEditor, getRawValue, getStyleEl, getValidateOnBlur, getValidationDelay, getValue, initValue, isDirty, isFireChangeEventOnSetValue, isHideLabel, isInEditor, isReadOnly, isValid, markInvalid, onBlur, onClick, onDetach, onFocus, onHide, onKeyDown, onKeyPress, onKeyUp, onShow, removeInputStyleName, removeKeyListener, setAutoValidate, setEmptyText, setFieldLabel, setFireChangeEventOnSetValue, setHideLabel, setImages, setInEditor, setInputStyleAttribute, setLabelSeparator, setLabelStyle, setMessages, setMessageTarget, setName, setOriginalValue, setPropertyEditor, setRawValue, setTabIndex, setValidateOnBlur, setValidationDelay, setValue, updateOriginalValue, validate, validate
 
Methods inherited from class com.extjs.gxt.ui.client.widget.BoxComponent
adjustPosition, adjustSize, getBounds, getHeight, getHeight, getPosition, getPositionEl, getResizeEl, getShadow, getShadowOffset, getShadowPosition, getSize, getWidth, getWidth, hideShadow, hideShim, hideUnders, isAutoHeight, isAutoWidth, isDeferHeight, isShim, onPosition, onUnload, setAutoHeight, setAutoWidth, setBounds, setBounds, setDeferHeight, setHeight, setHeight, setPagePosition, setPagePosition, setPixelSize, setPosition, setShadow, setShadowOffset, setShadowPosition, setShim, setSize, setSize, setWidth, setWidth, sync, syncSize
 
Methods inherited from class com.extjs.gxt.ui.client.widget.Component
addAttachable, addListener, addPlugin, addStyleName, addStyleOnOver, addWidgetListener, applyState, assertAfterRender, assertPreRender, beforeRender, blur, clearState, createObservable, createStyles, disable, disableContextMenu, disableEvents, disableTextSelection, el, enable, enableEvents, fireEvent, fireEvent, fireEvent, fly, frame, getAriaSupport, getBaseStyle, getBorders, getContextMenu, getData, getElement, getFocusEl, getFocusSupport, getHideMode, getId, getItemId, getListeners, getModel, getObservable, getPlugins, getState, getStateId, getTabIndex, getTitle, getToolTip, getWindowResizeDelay, hasListeners, hasListeners, hide, hideToolTip, initState, isDisabledEvents, isDisableTextSelection, isEnabled, isMasked, isMonitorWindowResize, isRendered, isStateful, isVisible, isVisible, mask, mask, mask, onAttach, onDetachHelper, onEnsureDebugId, onHideContextMenu, onLoad, onRightClick, onShowContextMenu, onWindowResize, previewEvent, recalculate, removeAllListeners, removeAttachagle, removeFromParent, removeListener, removeStyleName, removeStyleOnOver, removeSwallow, removeToolTip, removeWidgetListener, render, render, repaint, saveState, setAriaRole, setAriaState, setAriaSupport, setBorders, setContextMenu, setData, setEl, setElement, setElement, setEnabled, setFiresEvents, setHideMode, setId, setIntStyleAttribute, setItemId, setModel, setMonitorWindowResize, setParent, setStateful, setStateId, setStyleAttribute, setStyleName, setTitle, setToolTip, setToolTip, setVisible, setWindowResizeDelay, setZIndex, show, sinkEvents, swallowEvent, swallowEvent, toString, unframe, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, setLayoutData
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, setElement, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkBitlessEvent, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fields

protected java.util.List<Field<?>> fields

lc

protected LayoutContainer lc

orientation

protected Style.Orientation orientation

spacing

protected int spacing

validator

protected Validator validator
Constructor Detail

MultiField

public MultiField()
Creates a new multi-field.


MultiField

public MultiField(java.lang.String fieldLabel,
                  Field<?>... fields)
Creates a new multi-field.

Parameters:
fieldLabel - the field label
fields - the field(s) to add
Method Detail

add

public void add(Field<?> field)
Adds a field (pre-render).

Parameters:
field - the field to add

clear

public void clear()
Description copied from class: Field
Clears the value from the field.

Overrides:
clear in class Field<D>

get

public Field<?> get(int index)
Returns the field at the index.

Parameters:
index - the index
Returns:
the field

getAll

public java.util.List<Field<?>> getAll()
Returns all the child field's.

Returns:
the fields

getOrientation

public Style.Orientation getOrientation()
Returns the fields orientation.

Returns:
the orientation

getSpacing

public int getSpacing()
Returns the field's spacing.

Returns:
the spacing

getValidator

public Validator getValidator()
Returns the field's validator.

Returns:
the validator

isResizeFields

public boolean isResizeFields()
Returns true if child fields are being resized.

Returns:
the resize field state

isValid

public boolean isValid(boolean silent)
Description copied from class: Field
Returns whether or not the field value is currently valid.

Overrides:
isValid in class Field<D>
Parameters:
silent - 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(com.google.gwt.user.client.Event event)
Description copied from class: Component
Components delegate event handling to Component.onComponentEvent(ComponentEvent). Subclasses should not override.

Specified by:
onBrowserEvent in interface com.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent in class Component
Parameters:
event - the dom event

onComponentEvent

public void onComponentEvent(ComponentEvent ce)
Description copied from class: Component
Any events a component receives will be forwarded to this method. Subclasses should override as needed. The Component.onBrowserEvent(com.google.gwt.user.client.Event) method should not be overridden or modified.

Overrides:
onComponentEvent in class Field<D>
Parameters:
ce - the base event

reset

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

Overrides:
reset in class Field<D>

setOrientation

public void setOrientation(Style.Orientation orientation)
Sets the fields orientation (defaults to horizontal).

Parameters:
orientation - the orientation

setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from class: Field
Sets the field's read only state.

Overrides:
setReadOnly in class Field<D>
Parameters:
readOnly - the read only state

setResizeFields

public void setResizeFields(boolean resizeFields)
True to resize the child fields to fit available space (defaults to false).

Parameters:
resizeFields - true to resize children

setSpacing

public void setSpacing(int spacing)
Sets the amount of spacing between fields. Spacing is applied to the right of each field for horizontal orientation and applied to the bottom of each field for vertical orientation (defaults to 0, pre-render).

Parameters:
spacing - the spacing in pixels

setValidator

public void setValidator(Validator validator)
Sets the field's validator.

Parameters:
validator - the validator

doAttachChildren

protected void doAttachChildren()
Overrides:
doAttachChildren in class Component

doDetachChildren

protected void doDetachChildren()
Overrides:
doDetachChildren in class Field<D>

getInputEl

protected El getInputEl()
Description copied from class: Field
Provides support for wrapping the actual input element.

Overrides:
getInputEl in class Field<D>
Returns:
the input element

notifyHide

protected void notifyHide()
Overrides:
notifyHide in class Component

notifyShow

protected void notifyShow()
Overrides:
notifyShow in class Component

onDisable

protected void onDisable()
Overrides:
onDisable in class Field<D>

onEnable

protected void onEnable()
Overrides:
onEnable in class Field<D>

onRender

protected void onRender(com.google.gwt.user.client.Element target,
                        int index)
Description copied from class: Component
Subclasses must override and ensure setElement is called for lazy rendered components.

Overrides:
onRender in class Field<D>
Parameters:
target - the target element
index - the insert location

onResize

protected void onResize(int width,
                        int height)
Description copied from class: BoxComponent
Called after the component 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.

Overrides:
onResize in class Field<D>
Parameters:
width - the width
height - the height

validateValue

protected boolean validateValue(java.lang.String value)
Description copied from class: Field
Subclasses should provide the validation implementation by overriding this.

Overrides:
validateValue in class Field<D>
Parameters:
value - the value to validate
Returns:
true for valid