com.smartgwt.client.widgets.form.fields
Class TextAreaItem

java.lang.Object
  extended by com.smartgwt.client.core.JsObject
      extended by com.smartgwt.client.core.DataClass
          extended by com.smartgwt.client.core.RefDataClass
              extended by com.smartgwt.client.widgets.form.fields.FormItem
                  extended by com.smartgwt.client.widgets.form.fields.TextAreaItem
All Implemented Interfaces:
HasHandlers, HasBlurHandlers, HasChangedHandlers, HasChangeHandlers, HasClickHandlers, HasDoubleClickHandlers, HasFocusHandlers, HasIconClickHandlers, HasIconKeyPressHandlers, HasItemHoverHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasTitleClickHandlers, HasTitleDoubleClickHandlers, HasTitleHoverHandlers
Direct Known Subclasses:
AutoFitTextAreaItem

public class TextAreaItem
extends FormItem

Class for editable multi-line text areas (uses HTML <TEXTAREA> object)


Field Summary
 
Fields inherited from class com.smartgwt.client.core.JsObject
jsObj
 
Constructor Summary
TextAreaItem()
           
TextAreaItem(JavaScriptObject jsObj)
           
TextAreaItem(java.lang.String name)
           
TextAreaItem(java.lang.String name, java.lang.String title)
           
 
Method Summary
 void deselectValue()
          If this item currently has focus, clear the current selection.
 void deselectValue(boolean start)
          If this item currently has focus, clear the current selection.
 java.lang.Boolean getChangeOnKeypress()
          Should this form item fire its change handler (and store its value in the form) on every keypress? Set to false to suppress the 'change' handler firing (and the value stored) on every keypress.
 java.lang.String getEnteredValue()
          Returns the raw text value typed into this form field, which can differ from FormItem.getValue in various cases - for example: for items that constrain the value range, such as a DateItem with enforceDate:true, or a ComboBoxItem with addUnknownValues:false for items with a defined valueMap or edit value formatter and parser functions which converts display value to data value while the item has focus if changeOnKeypress is false
 int getHeight()
          default height of this item
 VerticalAlignment getIconVAlign()
          Align icons with the top edge of text area icons by default.
 java.lang.Integer getLength()
          Return the length.
 int getMinHeight()
          Minimum valid height for this TextAreaItem in px.
static TextAreaItem getOrCreateRef(JavaScriptObject jsObj)
           
 java.lang.Boolean getPrintFullText()
          When generating a print-view of the component containing this TextArea, should the form item expand to accommodate its value? If set to false the text box not expand to fit its content in the print view, instead showing exactly as it does in the live form, possibly with scrollbars.
 int[] getSelectionRange()
          For text-based items, this method returns the indices of the start/end of the current selection.
 java.lang.Boolean getSelectOnFocus()
          Allows the selectOnFocus behavior to be configured on a per-FormItem basis.
 java.lang.Boolean getShowHintInField()
          If showing hint for this form item, should it be shown within the field?
 java.lang.String getTextBoxStyle()
          Base CSS class to apply to this item's input element.
 java.lang.String getValueAsString()
          Return the value tracked by this form item.
 int getWidth()
          default width of this item
 TextAreaWrap getWrap()
          Text wrapping style.
 void selectValue()
          Put focus in this item and select the entire value.
 void setChangeOnKeypress(java.lang.Boolean changeOnKeypress)
          Should this form item fire its change handler (and store its value in the form) on every keypress? Set to false to suppress the 'change' handler firing (and the value stored) on every keypress.
 void setHeight(int height)
          default height of this item
 void setIconVAlign(VerticalAlignment iconVAlign)
          Align icons with the top edge of text area icons by default.
 void setLength(java.lang.Integer length)
          Set the length.
 void setMinHeight(int minHeight)
          Minimum valid height for this TextAreaItem in px.
 void setPrintFullText(java.lang.Boolean printFullText)
          When generating a print-view of the component containing this TextArea, should the form item expand to accommodate its value? If set to false the text box not expand to fit its content in the print view, instead showing exactly as it does in the live form, possibly with scrollbars.
 void setSelectionRange(int start, int end)
          Puts focus into this form item and selects characters between the given indices.
 void setSelectOnFocus(java.lang.Boolean selectOnFocus)
          Allows the selectOnFocus behavior to be configured on a per-FormItem basis.
 void setShowHintInField(java.lang.Boolean showHintInField)
          If showing hint for this form item, should it be shown within the field?
 void setTextBoxStyle(java.lang.String textBoxStyle)
          Base CSS class to apply to this item's input element.
 void setWidth(int width)
          default width of this item
 void setWrap(TextAreaWrap wrap)
          Text wrapping style.
 
Methods inherited from class com.smartgwt.client.widgets.form.fields.FormItem
addBlurHandler, addChangedHandler, addChangeHandler, addClickHandler, addDoubleClickHandler, addFocusHandler, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, blurItem, canEditCriterion, clearValue, disable, enable, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getBrowserSpellCheck, getCanFocus, getCellHeight, getCellStyle, getConfig, getContainerWidget, getCriteriaField, getCriterion, getCriterion, getDataPath, getDateFormatter, getDefaultIconSrc, getDisabled, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getFetchMissingValues, getFieldName, getFilterLocally, getForm, getFullDataPath, getGlobalTabIndex, getHint, getHintStyle, getHoverAlign, getHoverDelay, getHoverHeight, getHoverOpacity, getHoverStyle, getHoverVAlign, getHoverWidth, getIcon, getIconHeight, getIconPageRect, getIconPrompt, getIconRect, getIconWidth, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getLocateItemBy, getMultipleValueSeparator, getName, getOperator, getOptionCriteria, getOptionFilterContext, getOptionOperationId, getPageLeft, getPageRect, getPageTop, getPickerIconHeight, getPickerIconName, getPickerIconSrc, getPickerIconWidth, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getRect, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRowSpan, getSelectedRecord, getShouldSaveValue, getShowDisabled, getShowErrorIcon, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowOverIcons, getShowPickerIcon, getShowTitle, getShowValueIconOnly, getStartRow, getStopOnError, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTimeFormatter, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getValidateOnChange, getValidateOnExit, getValidOperators, getValue, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getVisible, getVisibleHeight, getVisibleWidth, getWrapTitle, hasAdvancedCriteria, hide, invalidateDisplayValueCache, isCreated, isDisabled, isDrawn, redraw, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setBrowserSpellCheck, setCanFocus, setCellHeight, setCellStyle, setColSpan, setColSpan, setCriteriaField, setCriterion, setDataPath, setDateFormatter, setDefaultIconSrc, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisplayField, setDisplayFormat, setDisplayFormat, setEditorType, setEditorValueFormatter, setEditorValueParser, setEmptyDisplayValue, setEmptyValueIcon, setEndRow, setErrorFormatter, setErrorIconHeight, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setFetchMissingValues, setFilterLocally, setGlobalTabIndex, setHeight, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverHeight, setHoverOpacity, setHoverStyle, setHoverVAlign, setHoverWidth, setIconHeight, setIconPrompt, setIcons, setIconWidth, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setLeft, setLocateItemBy, setMultipleValueSeparator, setName, setOperator, setOptionCriteria, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setPickerIconHeight, setPickerIconName, setPickerIconSrc, setPickerIconWidth, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRowSpan, setShouldSaveValue, setShowDisabled, setShowErrorIcon, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIfCondition, setShowOverIcons, setShowPickerIcon, setShowTitle, setShowValueIconOnly, setStartRow, setStopOnError, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTimeFormatter, setTitle, setTitleAlign, setTitleColSpan, setTitleOrientation, setTitleStyle, setTitleVAlign, setTooltip, setTop, setType, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueField, setValueFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setWidth, setWrapTitle, shouldFetchMissingValue, show, showPicker, stopHover, updateState, validate
 
Methods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef
 
Methods inherited from class com.smartgwt.client.core.DataClass
doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute
 
Methods inherited from class com.smartgwt.client.core.JsObject
setJsObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

TextAreaItem

public TextAreaItem()

TextAreaItem

public TextAreaItem(JavaScriptObject jsObj)

TextAreaItem

public TextAreaItem(java.lang.String name)

TextAreaItem

public TextAreaItem(java.lang.String name,
                    java.lang.String title)
Method Detail

getOrCreateRef

public static TextAreaItem getOrCreateRef(JavaScriptObject jsObj)

setChangeOnKeypress

public void setChangeOnKeypress(java.lang.Boolean changeOnKeypress)
Should this form item fire its change handler (and store its value in the form) on every keypress? Set to false to suppress the 'change' handler firing (and the value stored) on every keypress.

Note: If false, the value returned by getValue will not reflect the value displayed in the form item element as long as focus is in the form item element.

Parameters:
changeOnKeypress - changeOnKeypress Default value is true

getChangeOnKeypress

public java.lang.Boolean getChangeOnKeypress()
Should this form item fire its change handler (and store its value in the form) on every keypress? Set to false to suppress the 'change' handler firing (and the value stored) on every keypress.

Note: If false, the value returned by getValue will not reflect the value displayed in the form item element as long as focus is in the form item element.

Returns:
Boolean

setHeight

public void setHeight(int height)
default height of this item

Overrides:
setHeight in class FormItem
Parameters:
height - height Default value is 100
See Also:
Appearance overview and related methods

getHeight

public int getHeight()
default height of this item

Overrides:
getHeight in class FormItem
Returns:
int
See Also:
Appearance overview and related methods

setIconVAlign

public void setIconVAlign(VerticalAlignment iconVAlign)
Align icons with the top edge of text area icons by default.

Overrides:
setIconVAlign in class FormItem
Parameters:
iconVAlign - iconVAlign Default value is Canvas.TOP

getIconVAlign

public VerticalAlignment getIconVAlign()
Align icons with the top edge of text area icons by default.

Overrides:
getIconVAlign in class FormItem
Returns:
VerticalAlignment

setMinHeight

public void setMinHeight(int minHeight)
Minimum valid height for this TextAreaItem in px. If the specified height is less than this value, the text area will still render at this height.

Parameters:
minHeight - minHeight Default value is 16

getMinHeight

public int getMinHeight()
Minimum valid height for this TextAreaItem in px. If the specified height is less than this value, the text area will still render at this height.

Returns:
int

setPrintFullText

public void setPrintFullText(java.lang.Boolean printFullText)
When generating a print-view of the component containing this TextArea, should the form item expand to accommodate its value? If set to false the text box not expand to fit its content in the print view, instead showing exactly as it does in the live form, possibly with scrollbars.

Parameters:
printFullText - printFullText Default value is true
See Also:
Printing overview and related methods

getPrintFullText

public java.lang.Boolean getPrintFullText()
When generating a print-view of the component containing this TextArea, should the form item expand to accommodate its value? If set to false the text box not expand to fit its content in the print view, instead showing exactly as it does in the live form, possibly with scrollbars.

Returns:
Boolean
See Also:
Printing overview and related methods

setSelectOnFocus

public void setSelectOnFocus(java.lang.Boolean selectOnFocus)
Allows the selectOnFocus behavior to be configured on a per-FormItem basis. Normally all items in a form default to the value of selectOnFocus.

Overrides:
setSelectOnFocus in class FormItem
Parameters:
selectOnFocus - selectOnFocus Default value is null
See Also:
Focus overview and related methods

getSelectOnFocus

public java.lang.Boolean getSelectOnFocus()
Allows the selectOnFocus behavior to be configured on a per-FormItem basis. Normally all items in a form default to the value of selectOnFocus.

Overrides:
getSelectOnFocus in class FormItem
Returns:
Boolean
See Also:
Focus overview and related methods

setShowHintInField

public void setShowHintInField(java.lang.Boolean showHintInField)
If showing hint for this form item, should it be shown within the field?

CSS style for the hint is textBoxStyle with the suffix "Hint" appended to it.

Note : This is an advanced setting

Parameters:
showHintInField - showHintInField Default value is null
See Also:
FormItem.setHint(java.lang.String), Appearance overview and related methods

getShowHintInField

public java.lang.Boolean getShowHintInField()
If showing hint for this form item, should it be shown within the field?

CSS style for the hint is textBoxStyle with the suffix "Hint" appended to it.

Returns:
Boolean
See Also:
FormItem.getHint(), Appearance overview and related methods

setTextBoxStyle

public void setTextBoxStyle(java.lang.String textBoxStyle)
Base CSS class to apply to this item's input element. NOTE: See the CompoundFormItem_skinning discussion for special skinning considerations.

Overrides:
setTextBoxStyle in class FormItem
Parameters:
textBoxStyle - textBoxStyle Default value is "textItem"
See Also:
Appearance overview and related methods

getTextBoxStyle

public java.lang.String getTextBoxStyle()
Base CSS class to apply to this item's input element. NOTE: See the CompoundFormItem_skinning discussion for special skinning considerations.

Overrides:
getTextBoxStyle in class FormItem
Returns:
String
See Also:
Appearance overview and related methods

setWidth

public void setWidth(int width)
default width of this item

Overrides:
setWidth in class FormItem
Parameters:
width - width Default value is 150
See Also:
Appearance overview and related methods

getWidth

public int getWidth()
default width of this item

Overrides:
getWidth in class FormItem
Returns:
int
See Also:
Appearance overview and related methods

deselectValue

public void deselectValue()
If this item currently has focus, clear the current selection. leaving focus in the item. Has no effect if the item is undrawn or unfocused. Only applies to text-based items.


deselectValue

public void deselectValue(boolean start)
If this item currently has focus, clear the current selection. leaving focus in the item. Has no effect if the item is undrawn or unfocused. Only applies to text-based items.

Parameters:
start - By default the text insertion cursor will be moved to the end of the current value - pass in this parameter to move to the start instead

getEnteredValue

public java.lang.String getEnteredValue()
Returns the raw text value typed into this form field, which can differ from FormItem.getValue in various cases - for example:

Returns:
current entered value

selectValue

public void selectValue()
Put focus in this item and select the entire value. Only applies to text based items


setSelectionRange

public void setSelectionRange(int start,
                              int end)
Puts focus into this form item and selects characters between the given indices. Only applies to drawn text based items.

Parameters:
start - selection starting character index
end - end of selection character index

setLength

public void setLength(java.lang.Integer length)
Set the length.

Parameters:
length - the length

getLength

public java.lang.Integer getLength()
Return the length.

Returns:
the length

setWrap

public void setWrap(TextAreaWrap wrap)
Text wrapping style.

Parameters:
wrap - wrap Default value is TextAreaWrap.SOFT

getWrap

public TextAreaWrap getWrap()
Text wrapping style.

Returns:
TextAreaWrap

getSelectionRange

public int[] getSelectionRange()
For text-based items, this method returns the indices of the start/end of the current selection. Returns null if the item doesn't have focus.

Returns:
2 element array showing character index of the current selection's start and end point within this item's value. May be null if the item doesn't have focus.

getValueAsString

public java.lang.String getValueAsString()
Return the value tracked by this form item.

Returns:
value of this element