com.sun.j2ee.blueprints.ui.autocomplete
Class AutoCompleteComponent

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UIOutput
              extended byjavax.faces.component.UIInput
                  extended byjavax.faces.component.html.HtmlInputText
                      extended bycom.sun.j2ee.blueprints.ui.autocomplete.AutoCompleteComponent
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class AutoCompleteComponent
extends javax.faces.component.html.HtmlInputText

Completion-capable JSF text field. The component has a completionMethod which is called repeatedly (asynchronously) and is in charge of registering completion results (which will be populated in the completion dialog for this field).

The component will render CSS and JavaScript into the page. These JavaScript and CSS class names could potentially interact with your own JSP contents if there is a name conflict so if you observe strange results, try changing your method names or style classes.

FIXME Pick more unique namespace names for the style classes and the javascript methods - perhaps prefixed by "ajax" or "ajtf" (ajax text field), or maybe even "blueprints" ? FIXME Add property "maxResults", setting the max number of completion items shown in the completion popup FIXME Add property "Delay (milliseconds)" - an optional timer delay before popup should appear or get updated after keystrokes FIXME Add property "showOnFocus", which when set will cause the completion dialog to be shown showing the first possible matches even before the user has typed anything into the text field


Field Summary
 
Fields inherited from class javax.faces.component.html.HtmlInputText
COMPONENT_TYPE
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Constructor Summary
AutoCompleteComponent()
           
 
Method Summary
 javax.faces.el.MethodBinding getCompletionMethod()
           
 java.lang.String getFamily()
           
 int getMaxCount()
          Return the maximum number of results returned from this text field
 java.lang.String getOnchoose()
           
 java.lang.String getOndisplay()
           
 java.lang.String getText()
          Render a textual textfield.
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setCompletionMethod(javax.faces.el.MethodBinding completionMethod)
           
 void setOnchoose(java.lang.String onchoose)
           
 void setOndisplay(java.lang.String ondisplay)
           
 void setText(java.lang.String text)
           
 
Methods inherited from class javax.faces.component.html.HtmlInputText
getAccesskey, getAlt, getDir, getLang, getMaxlength, getOnblur, getOnchange, getOnclick, getOndblclick, getOnfocus, getOnkeydown, getOnkeypress, getOnkeyup, getOnmousedown, getOnmousemove, getOnmouseout, getOnmouseover, getOnmouseup, getOnselect, getSize, getStyle, getStyleClass, getTabindex, getTitle, isDisabled, isReadonly, setAccesskey, setAlt, setDir, setDisabled, setLang, setMaxlength, setOnblur, setOnchange, setOnclick, setOndblclick, setOnfocus, setOnkeydown, setOnkeypress, setOnkeyup, setOnmousedown, setOnmousemove, setOnmouseout, setOnmouseover, setOnmouseup, setOnselect, setReadonly, setSize, setStyle, setStyleClass, setTabindex, setTitle
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, broadcast, compareValues, decode, getConvertedValue, getSubmittedValue, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, setValue, setValueChangeListener, updateModel, validate, validateValue
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter
 

Constructor Detail

AutoCompleteComponent

public AutoCompleteComponent()
Method Detail

getFamily

public java.lang.String getFamily()

saveState

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

restoreState

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

setOnchoose

public void setOnchoose(java.lang.String onchoose)

getOnchoose

public java.lang.String getOnchoose()

setOndisplay

public void setOndisplay(java.lang.String ondisplay)

getOndisplay

public java.lang.String getOndisplay()

setCompletionMethod

public void setCompletionMethod(javax.faces.el.MethodBinding completionMethod)

getCompletionMethod

public javax.faces.el.MethodBinding getCompletionMethod()

getText

public java.lang.String getText()

Render a textual textfield.


setText

public void setText(java.lang.String text)
See Also:
getText()

getMaxCount

public int getMaxCount()
Return the maximum number of results returned from this text field

Returns:
A numberf indicating the maximum number of completion matches that should be returned/displayed