Class WFYAHOO_widget_AutoComplete

Description

A YAHOO AutoComplete widget for our framework. This widget acts like a ComboBox: it is a text field with a pick-list and OPTIONAL custom entry.

PHOCOA Builder Setup:

Required:
none

Optional:

  • todo: AJAX lookups seem to be failing... JSON is getting returned but no results displayed.

Located in /framework/widgets/yahoo/WFYAHOO_widget_AutoComplete.php (line 23)

WFObject
   |
   --WFView
      |
      --WFWidget
         |
         --WFYAHOO
            |
            --WFYAHOO_widget_AutoComplete
Class Constant Summary
Variable Summary
Method Summary
static void exposedProperties ()
WFYAHOO_widget_AutoComplete __construct ( $id,  $page)
void ajaxLoadData ( $page,  $params)
void initJS ( $blockContent)
void render ([ $blockContent = NULL])
void restoreState ()
void setAnimHoriz ( $b)
void setAnimVert ( $b)
void setDatasourceJSArray ( $a)
void setDynamicDataLoader (mixed $callback, [array $schema = array('k')])
void setDynamicDataLoaderSchema ( $schema)
Variables
boolean $allowBrowserAutocomplete = NULL (line 107)
  • var: All browser built-in "autocomplete" behavior in this field. Default: true. You may want to turn this off for sensitive data fields.
  • access: protected
boolean $alwaysShowContainer = NULL (line 111)
  • var: True to show the container even if there is no text entered. Default: false. Useful in conjunction with minQueryLength.
  • access: protected
boolean $animHoriz = NULL (line 55)
  • var: TRUE to animate horizontally. Default: false.
  • access: protected
float $animSpeed = NULL (line 59)
  • var: The number of seconds for the animation to take to "open" the autocomplete suggestions. Default: 0.3.
  • access: protected
boolean $animVert = NULL (line 51)
  • var: TRUE to animate vertically. Default: true.
  • access: protected
string $autocompleteWidth = '100%' (line 47)
  • var: The css width of the autocomplete box. Remeber to specify like "100px" or "80%". Default: 100%.
  • access: protected
boolean $autoHighlight = NULL (line 79)
  • var: Whether or not the first item in the list is automatically highlighted. Default: true.
  • access: protected
integer $datasource = NULL (line 116)
  • var: Which of the DATASOURCE_* methods will be used for this instance.
  • access: protected
array $datasourceJSArray = NULL (line 124)
  • var: When using DATASOURCE_JS_ARRAY, this is the array of items. It can be a simple array, or an array of arrays. The latter will be used as multi-column data.
  • access: protected
mixed $datasourceMaxCacheEntries = NULL (line 117)
  • access: protected
mixed $datasourceQueryMatchCase = NULL (line 118)
  • access: protected
mixed $datasourceQueryMatchContains = NULL (line 119)
  • access: protected
mixed $datasourceQueryMatchSubset = NULL (line 120)
  • access: protected
mixed $delimChar = NULL (line 63)
  • var: The "delim" char used to help autocomplete multiple items. Can pass a single char or an array of single chars. Default: none;
  • access: protected
mixed $dynamicDataLoader = NULL (line 127)
  • access: protected
mixed $dynamicDataLoaderSchema = NULL (line 128)
  • access: protected
boolean $forceSelection = NULL (line 99)
  • var: True to force users to choose one of the list items and not be allowed to enter their own text. Default: false
  • access: protected
string $height = '50px' (line 43)
  • var: The css height of the input. Remember to specify like "200px" or "15em". Only used for INPUT_TYPE_TEXTAREA. Default: 50px.
  • access: protected
string $highlightClassName = NULL (line 83)
  • var: The class name to apply to all li elements in the autocomplete results. Default: yui-ac-highlight
  • access: protected
string $inputType = self::INPUT_TYPE_TEXTFIELD (line 35)
integer $maxResultsDisplayed = NULL (line 67)
  • var: Maximum number of items to display in the autocomplete list. Default: 10
  • access: protected
integer $minQueryLength = NULL (line 71)
  • var: Minimum number of chars that must be in the field before the autocomplete kicks in. Default: 1. Use 0 in conjunction with {WFYAHOO_widget_AutoComplete::$alwaysShowContainer alwaysShowContainer}.
  • access: protected
string $prehighlightClassName = NULL (line 87)
  • var: The class name to apply to all li elements during pre-click mouseover of mouse selection. Default: yui-ac-prehighlight
  • access: protected
float $queryDelay = NULL (line 75)
  • var: The time in seconds that autocomplete waits from the last key entry until looking up results. Default: 0.5.
  • access: protected
boolean $typeAhead = NULL (line 103)
  • var: True to cause the user's input to be automatically completed with the first match. Default: false
  • access: protected
boolean $useIFrame = NULL (line 95)
  • var: True to use an IFRAME in IE 5.x and IE 6 to fix a visual bug. If your autocomplete container appears on top of a form select element, you'll want to set this to true. Default: false.
  • access: protected
boolean $useShadow = NULL (line 91)
  • var: Whether or not to use a drop-shadow on the autocomplete container. Default: false. If you set to true, be sure to set up a call 'yui-ac-shadow'.
  • access: protected
string $width = '200px' (line 39)
  • var: The css width of the input. Remember to specify like "200px" or "15em". Default: 200px.
  • access: protected

Inherited Variables

Inherited from WFYAHOO

WFYAHOO::$initializeWaitsForID

Inherited from WFWidget

WFWidget::$bindings
WFWidget::$class
WFWidget::$errors
WFWidget::$formatter
WFWidget::$hasRestoredState
WFWidget::$hidden
WFWidget::$name
WFWidget::$value
WFWidget::$widgetLabel

Inherited from WFView

WFView::$children
WFView::$cssImports
WFView::$enabled
WFView::$id
WFView::$importInHead
WFView::$jsActions
WFView::$jsEvents
WFView::$jsImports
WFView::$originalOnEvent
WFView::$page
WFView::$parent
Methods
static method exposedProperties (line 233)
  • access: public
static void exposedProperties ()

Redefinition of:
WFWidget::exposedProperties()
Constructor __construct (line 133)

Constructor.

WFYAHOO_widget_AutoComplete __construct ( $id,  $page)
  • $id
  • $page

Redefinition of:
WFYAHOO::__construct()
Constructor.
ajaxLoadData (line 184)
  • access: public
void ajaxLoadData ( $page,  $params)
  • $page
  • $params
canPushValueBinding (line 446)
void canPushValueBinding ()

Redefinition of:
WFYAHOO::canPushValueBinding()
initJS (line 331)
void initJS ( $blockContent)
  • $blockContent

Redefinition of:
WFYAHOO::initJS()
The initJS function is where YUI widgets perform their bootstrap/initialization.
render (line 283)
void render ([ $blockContent = NULL])
  • $blockContent

Redefinition of:
WFYAHOO::render()
IMPORTANT: The subclasses should get the base class's html, then add the needed code.
restoreState (line 271)
void restoreState ()

Redefinition of:
WFWidget::restoreState()
Restore the UI state of this widget from the $_REQUEST data.
setAnimHoriz (line 215)
  • access: public
void setAnimHoriz ( $b)
  • $b
setAnimVert (line 206)
  • access: public
void setAnimVert ( $b)
  • $b
setDatasourceJSArray (line 264)
  • access: public
void setDatasourceJSArray ( $a)
  • $a
setDynamicDataLoader (line 157)

Set up a dataloader callback for dynamically loading autocomplete matches.

The callback function prototype is:

(array) loadMatchesForQuery($page, $params, $query)

return: array An array of assoc_arrays in structure ["QueryKey","AdditionalData1",..."AdditionalDataN"]

  • throws: object WFException If the callback is invalid.
void setDynamicDataLoader (mixed $callback, [array $schema = array('k')])
  • mixed $callback: Callback. string A method on the page delegate object to call to get the child nodes. array A php callback structure.
  • array $schema: An array strings with the schema of the data returned from the callback.
setDynamicDataLoaderSchema (line 173)
void setDynamicDataLoaderSchema ( $schema)
  • $schema
setupExposedBindings (line 224)
void setupExposedBindings ()

Redefinition of:
WFWidget::setupExposedBindings()
Set up all exposed bindings for this widget.

Inherited Methods

Inherited From WFYAHOO

WFYAHOO::__construct()
WFYAHOO::canPushValueBinding()
WFYAHOO::initJS()
WFYAHOO::jsForSimplePropertyConfig()
WFYAHOO::jsValueForValue()
WFYAHOO::render()
WFYAHOO::yuiloader()

Inherited From WFWidget

WFWidget::__construct()
WFWidget::addError()
WFWidget::addErrors()
WFWidget::bind()
WFWidget::bindingByName()
WFWidget::bindings()
WFWidget::canPushValueBinding()
WFWidget::errors()
WFWidget::exposedBindings()
WFWidget::exposedProperties()
WFWidget::formattedValue()
WFWidget::formatter()
WFWidget::hasRestoredState()
WFWidget::hidden()
WFWidget::name()
WFWidget::processBindingOptions()
WFWidget::propagateValueToBinding()
WFWidget::pullBindings()
WFWidget::pushBindings()
WFWidget::restoreState()
WFWidget::setFormatter()
WFWidget::setHidden()
WFWidget::setName()
WFWidget::setupExposedBindings()
WFWidget::setValue()
WFWidget::setWidgetLabel()
WFWidget::unbind()
WFWidget::value()
WFWidget::valueForBinding()
WFWidget::widgetLabel()

Inherited From WFView

WFView::__construct()
WFView::addChild()
WFView::allConfigFinishedLoading()
WFView::children()
WFView::cloneWithID()
WFView::enabled()
WFView::exposedProperties()
WFView::getForm()
WFView::getJSActions()
WFView::getListenerJS()
WFView::getListenerJSInScriptTag()
WFView::getOnEvent()
WFView::getWidgetDir()
WFView::getWidgetWWWDir()
WFView::id()
WFView::importCSS()
WFView::importJS()
WFView::jsEndHTML()
WFView::jsStartHTML()
WFView::page()
WFView::parent()
WFView::removeChild()
WFView::render()
WFView::setEnabled()
WFView::setId()
WFView::setJSonBlur()
WFView::setJSonClick()
WFView::setListener()
WFView::setOnEvent()
WFView::setParent()
WFView::yuiPath()

Inherited From WFObject

WFObject::__construct()
WFObject::exposedProperties()
WFObject::getClass()
WFObject::keyPathToTargetAndKey()
WFObject::setValueForKey()
WFObject::setValueForKeyPath()
WFObject::setValuesForKeys()
WFObject::validatedSetValueForKey()
WFObject::validatedSetValueForKeyPath()
WFObject::validateObject()
WFObject::validateValueForKey()
WFObject::validateValueForKeyPath()
WFObject::valueForKey()
WFObject::valueForKeyPath()
WFObject::valueForStaticKey()
WFObject::valueForStaticKeyPath()
WFObject::valueForTargetAndKeyPath()
WFObject::valueForUndefinedKey()
WFObject::valueForUndefinedStaticKey()
WFObject::valuesForKeyPaths()
WFObject::valuesForKeys()
WFObject::_valueForStaticKey()
WFObject::__toString()
Class Constants
DATASOURCE_JS_ARRAY = 0 (line 25)
DATASOURCE_JS_FUNCTION = 1 (line 26)
DATASOURCE_XHR = 2 (line 27)
INPUT_TYPE_TEXTAREA = 'textarea' (line 30)
INPUT_TYPE_TEXTFIELD = 'input' (line 29)

Documentation generated on Thu, 14 May 2009 16:20:43 -0400 by phpDocumentor 1.4.2