AjaxAutoComplete Class Reference

Inherits er::ajax::AjaxComponent.

Collaboration diagram for AjaxAutoComplete:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 AjaxAutoComplete (WOContext context)
void appendToResponse (WOResponse res, WOContext ctx)
void awake ()
WOActionResults handleRequest (WORequest request, WOContext context)
String indicator ()
boolean isStateless ()
void setStringValue (String strValue)
void sleep ()
String stringValue ()
boolean synchronizesVariablesWithBindings ()
void takeValuesFromRequest (WORequest request, WOContext context)
String zcontainerName ()

Public Attributes

String divName
String fieldName
String indicatorName

Protected Member Functions

void addRequiredWebResources (WOResponse res)
void appendItemToResponse (Object value, WOElement child, boolean hasItem, WOResponse response, WOContext context)
NSDictionary createAjaxOptions ()
String displayStringForValue (Object value)
int maxItems ()

Package Functions

String listeJS ()


Detailed Description

Autocompleting combo-box similar to Google suggest.

This is a component that look like a text field, where when you start entering value, it start giving you a menu of options related to what you type. Think about the auto-completion feature of many IDE (XCode / Eclipse) inside a textField.

The scriptaculous library has 2 version of the autocompleter combo-box : a local version and an ajax version.

Local

The local version hold the list of values all in memory (client-side), there is no interaction. If the number of elements is big enough to be in a WOPopUP, then this variant is well suited for you. If the list of element to show is too big, then you might prefer the 'ajax' version.
You have to tell the component that it is local (by default it is 'ajax' type) using the isLocal binding. Then the list binding will need to provide all the objects needed to be found. Filtering of the list as you type will be done client-side, all javascript.

Ajax

Autocomplete field similar to what google has. You bind a value and a method that returns a list and it hits the server on each keystroke and displays the results.

list bound to a method that should return the whole list of object to be displayed. When used in an Ajax context, the component will push first to the <cite>value</cite> binding, giving you the chance to narrow the list of elements displayed. When used in a Local context, the list should contain all possible objects. the list will be filtered by the scriptaculous engine. value string that will hold the text entered in the field. It is continiously updated. item pushed and pulled the current element of the list. This can be used to customized the string representation (in conjuction with the <cite>displayString</cite> binding) of the object. displayString optional custom string representation of the current element. isLocal boolean indicating if you want the list to be completely client-side. Binding a true value, would mean that the list will filtered on the client. isLocalSharedList boolean indicating if the list needs to be shared. localSharedVarName the name of the javascript variable to use to store the list in. The list is stored in the userInfo dictionary on the server side to allow for shared use by multiple auto complete components. token frequency Look at the scriptaculous documentation. minChars Look at the scriptaculous documentation. indicator Look at the scriptaculous documentation. updateElement Look at the scriptaculous documentation. afterUpdateElement Look at the scriptaculous documentation. select Look at the scriptaculous documentation. onShow Look at the scriptaculous documentation. fullSearch Look at the scriptaculous documentation. partialSearch Look at the scriptaculous documentation. choices Look at the scriptaculous documentation (Local only) partialChars Look at the scriptaculous documentation (Local only) ignoreCase Look at the scriptaculous documentation (Local only) accesskey hot key that should activate the text field (optional) tabindex tab index of the text field (optional) default hint for the text field, when used together with AjaxTextHinter. selection if set, if the text field's string matches the displayString of one of the objects in the provided list, that object will be bound back as the selection. currently this only supports displayString renderers and not child templates class class attribute of the text field style class attribute of the text field onblur onblur attribute of the text field onfocus onfocus attribute of the text field onchange onchange attribute of the text field activateOnFocus activate when text field gets focus containerId tag id for the container of the popup div (default is body)

Author:
ak

Constructor & Destructor Documentation

AjaxAutoComplete ( WOContext  context  ) 


Member Function Documentation

void addRequiredWebResources ( WOResponse  res  )  [protected, virtual]

Adds all required resources.

Implements AjaxComponent.

void appendItemToResponse ( Object  value,
WOElement  child,
boolean  hasItem,
WOResponse  response,
WOContext  context 
) [protected]

void appendToResponse ( WOResponse  res,
WOContext  ctx 
)

Overridden to add the initialization javascript for the auto completer.

Reimplemented from AjaxComponent.

void awake (  ) 

Overridden to set the IDs for the field and the div tag.

NSDictionary createAjaxOptions (  )  [protected]

String displayStringForValue ( Object  value  )  [protected]

WOActionResults handleRequest ( WORequest  request,
WOContext  context 
) [virtual]

Handles the Ajax request. Checks for the form value in the edit field, pushes it up to the parent and pulls the "list" binding. The parent is responsible for returning a list with some items that match the current value.

Implements AjaxComponent.

String indicator (  ) 

boolean isStateless (  ) 

Overridden because the component is stateless

String listeJS (  )  [package]

int maxItems (  )  [protected]

void setStringValue ( String  strValue  ) 

void sleep (  ) 

String stringValue (  ) 

boolean synchronizesVariablesWithBindings (  ) 

Overridden because the component does not synch with the bindings.

void takeValuesFromRequest ( WORequest  request,
WOContext  context 
)

String zcontainerName (  ) 


Member Data Documentation


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:37 2012 for Project Wonder by  doxygen 1.5.8