|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.faces.component.UIComponent
javax.faces.component.UIComponentBase
javax.faces.component.UIOutput
javax.faces.component.UIInput
com.sun.webui.jsf.component.WebuiInput
com.sun.webui.jsf.component.HiddenField
com.sun.webui.jsf.component.Field
com.sun.webui.jsf.component.TextField
public class TextField
The TextField component renders input HTML element.
TextField Component class represents text input element.
As part of the dynamic behavior, TextField supports auto-validation, where
entered data is automatically validated through the ajax call to the server.
When validating data through the ajax-based mechanism, the UPDATE_MODEL_VALUES
stage of the lifecycle is skipped ( see processUpdates).
Another dynamic feature of TextField is an autoComplete. If autoComplete attribute is
specified as true
, this list will be rendered under the text input to allow user to pick
a selection from the list instead of ( or in addition to ) typing it. Once autoComplete is activated,
every time the content of the TextField is changed, the updated text field value is used to fetch
autocomplete list with Ajax call. Developer must provide bean method ( see attribute autoCompleteExpression)
to filter and retrieve options on every Ajax call. Such bean must implement AutoComplete
interface.
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 | |
---|---|
TextField()
Construct a new TextField . |
Method Summary | |
---|---|
javax.el.MethodExpression |
getAutoCompleteExpression()
Returns the stored autoCompleteExpression . |
java.lang.String |
getFamily()
Return the family for this component. |
java.lang.String |
getNotify()
Get the comma separated list of absolute client IDs to notify during text field events. |
java.lang.String |
getRendererType()
Returns the renderer type for the component. |
java.lang.String |
getValueAsString(javax.faces.context.FacesContext context)
Return the value to be rendered, as a String (converted if necessary), or null if the value is null. |
boolean |
isAutoComplete()
Test if default Ajax functionality should be turned off. |
boolean |
isAutoValidate()
Test if default Ajax functionality should be turned off. |
boolean |
isSubmitForm()
Flag indicating whether pressing enter in this text field would allow browser to submit the enclosing form. |
boolean |
isSubmitFormSet()
Returns true if submitForm attribute has been explicitely set, either through binding, value expression, or programmatically. |
void |
processUpdates(javax.faces.context.FacesContext context)
Specialized model update behavior on top of that provided by the superclass. |
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 |
setAutoComplete(boolean autoComplete)
Set attribute indicating to turn on/off default Ajax functionality. |
void |
setAutoCompleteExpression(javax.el.MethodExpression me)
Stores the autoCompleteExpression . |
void |
setAutoValidate(boolean autoValidate)
Set attribute indicating to turn on/off default Ajax functionality. |
void |
setNotify(java.lang.String notify)
Set the comma separated list of absolute client IDs to notify during text field events. |
void |
setSubmitForm(boolean submitForm)
Flag indicating whether pressing enter in this text field would allow browser to submit the enclosing form. |
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 |
---|
public TextField()
Construct a new TextField
.
Method Detail |
---|
public java.lang.String getFamily()
Return the family for this component.
getFamily
in class Field
public java.lang.String getRendererType()
getRendererType
in class HiddenField
public java.lang.String getValueAsString(javax.faces.context.FacesContext context)
Return the value to be rendered, as a String (converted
if necessary), or null
if the value is null.
getValueAsString
in class HiddenField
context
- FacesContext for the current request
public javax.el.MethodExpression getAutoCompleteExpression()
Returns the stored autoCompleteExpression
.
public void setAutoCompleteExpression(javax.el.MethodExpression me)
Stores the autoCompleteExpression
.
public boolean isAutoComplete()
public void setAutoComplete(boolean autoComplete)
< webuijsf:textField id="textFieldA" size="20" required="true" autoComplete="true" autoCompleteExpression="#{MyBean.autoCompleteExpression}" / >
public boolean isAutoValidate()
public void setAutoValidate(boolean autoValidate)
< webuijsf:textField id="textFieldA" text="4111 1111 1111 1111" label="Enter Credit Card Number" size="20" required="true" autoValidate="true" validatorExpression="#{Payment.cardValidator}" / >
public java.lang.String getNotify()
public void setNotify(java.lang.String notify)
public boolean isSubmitForm()
Flag indicating whether pressing enter in this text field would allow browser to submit the enclosing form.
public void setSubmitForm(boolean submitForm)
Flag indicating whether pressing enter in this text field would allow browser to submit the enclosing form.
isSubmitForm()
public boolean isSubmitFormSet()
Returns true if submitForm attribute has been explicitely set, either through binding, value expression, or programmatically. Returns false otherwise.
public void processUpdates(javax.faces.context.FacesContext context)
Specialized model update behavior on top of that provided by the superclass.
processUpdates
in class WebuiInput
context
- FacesContext
for this request.public void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
restoreState
in interface javax.faces.component.StateHolder
restoreState
in class Field
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
saveState
in interface javax.faces.component.StateHolder
saveState
in class Field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |