com.sun.webui.jsf.component
Class TextArea

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by com.sun.webui.jsf.component.WebuiInput
                      extended by com.sun.webui.jsf.component.HiddenField
                          extended by com.sun.webui.jsf.component.Field
                              extended by com.sun.webui.jsf.component.TextField
                                  extended by com.sun.webui.jsf.component.TextArea
All Implemented Interfaces:
com.sun.webui.jsf.component.ComplexComponent, javax.faces.component.EditableValueHolder, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class TextArea
extends TextField

The TextArea component is used to create a multiple-line input field for text. As part of the dynamic behavior, TextArea supports autoSave: when enabled, the content of the TextArea will be saved / submitted via ajax call to the server every number of autoSave milliseconds. Note that only the text value of the TextArea component will be saved, and other properties that could have been changed on the client side only (i.e. client modified columns, rows, label) will not be submitted to the server for autosave. Thus client side properties will only affect the client state ( unless explicitly commited by the developer).
As all ajaxified client-side rendered components, autoSave would trigger an event on the client side that can be intercepted by the developer in order to implement her own save/commit procedure.


Field Summary
 
Fields inherited from class com.sun.webui.jsf.component.Field
INPUT_ID, LABEL_FACET, LABEL_ID, READONLY_FACET, READONLY_ID
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
TextArea()
          Default constructor.
 
Method Summary
 long getAutoSave()
          Test if default Ajax functionality should be turned off.
 java.lang.String getFamily()
          Return the family for this component.
 int getMaxLength()
          The maximum number of characters that can be entered for this field.
 java.lang.String getRendererType()
          Returns the renderer type for the component.
 int getRows()
          Number of rows used to render the textarea.
 boolean isSubmitForm()
          Flag indicating whether pressing enter in this text field would allow browser to submit the enclosing form.
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setAutoSave(long autoSave)
          Set auto-save period.
 void setRows(int rows)
          Number of rows used to render the textarea.
 void setSubmitForm(boolean submitForm)
          SubmitForm is disabled for TextArea
 
Methods inherited from class com.sun.webui.jsf.component.TextField
getAutoCompleteExpression, getNotify, getValueAsString, isAutoComplete, isAutoValidate, isSubmitFormSet, processUpdates, setAutoComplete, setAutoCompleteExpression, setAutoValidate, setNotify
 
Methods inherited from class com.sun.webui.jsf.component.Field
getColumns, getFocusElementId, getIndicatorComponent, getLabel, getLabelComponent, getLabeledElementId, getLabelLevel, getOnBlur, getOnChange, getOnClick, getOnDblClick, getOnFocus, getOnKeyDown, getOnKeyPress, getOnKeyUp, getOnMouseDown, getOnMouseMove, getOnMouseOut, getOnMouseOver, getOnMouseUp, getOnSelect, getPrimaryElementID, getReadOnlyComponent, getStyle, getStyleClass, getTabIndex, getText, getToolTip, getValue, getValueExpression, isDisabled, isReadOnly, isRequired, isTrim, isVisible, setColumns, setDisabled, setLabel, setLabelLevel, setMaxLength, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setReadOnly, setStyle, setStyleClass, setTabIndex, setText, setToolTip, setTrim, setValueExpression, setVisible
 
Methods inherited from class com.sun.webui.jsf.component.HiddenField
getHtmlTemplate, getReadOnlyValueString, setHtmlTemplate
 
Methods inherited from class com.sun.webui.jsf.component.WebuiInput
broadcast, getValidator, getValidatorExpression, getValueChangeListener, getValueChangeListenerExpression, processDecodes, processValidators, setConverter, setId, setImmediate, setRendered, setRequired, setValidatorExpression, setValueChangeListenerExpression
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidatorMessage, getValidators, getValueChangeListeners, isImmediate, isLocalValueSet, isValid, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setLocalValueSet, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue
 
Methods inherited from class javax.faces.component.UIComponentBase
encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue
 

Constructor Detail

TextArea

public TextArea()
Default constructor.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Overrides:
getFamily in class TextField

getRendererType

public java.lang.String getRendererType()
Returns the renderer type for the component. Depending on the type of the request, this method will return the default renderer type of "com.sun.webui.jsf.widget.TextArea" in case of full render request, or "com.sun.webui.jsf.ajax.TextArea" in case of ajax request. Ajax request represents a special case of request, when partial data is rendered back to the client.

Overrides:
getRendererType in class TextField

getMaxLength

public int getMaxLength()
The maximum number of characters that can be entered for this field.

Overrides:
getMaxLength in class Field

getRows

public int getRows()

Number of rows used to render the textarea. You should set a value for this attribute to ensure that it is rendered correctly in all browsers. Browsers vary in the default number of rows used for textarea fields.


setRows

public void setRows(int rows)

Number of rows used to render the textarea. You should set a value for this attribute to ensure that it is rendered correctly in all browsers. Browsers vary in the default number of rows used for textarea fields.

See Also:
getRows()

getAutoSave

public long getAutoSave()
Test if default Ajax functionality should be turned off.


setAutoSave

public void setAutoSave(long autoSave)
Set auto-save period. Values of 0 or less mean no auto-save.

Parameters:
autoSave - - time period in millisec, or 0 if no autosave required

isSubmitForm

public boolean isSubmitForm()

Flag indicating whether pressing enter in this text field would allow browser to submit the enclosing form.

Overrides:
isSubmitForm in class TextField

setSubmitForm

public void setSubmitForm(boolean submitForm)

SubmitForm is disabled for TextArea

Overrides:
setSubmitForm in class TextField
See Also:
TextField.isSubmitForm()

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)

Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class TextField

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)

Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class TextField


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.