Archetypes autocomplete widget with support for String-, Lines- and ReferenceFields
Project description
Overview
To use this package just create a field like:
StringField('test_field', default='', searchable=0, required=0, vocabulary=DisplayList((('week', 'Week'), ('wedding','Wedding'), ('winona','Winona'), ('winter', 'Winter'), ('weather','Weather'), ('cow', 'Cow'))), widget=AutocompleteWidget(label='Test Widget', description='Test this', ), enforceVocabulary=0, ),
You can also use a LinesField instead of a StringField. The widget adapts automatically. This has the advantage that you can index the field in the catalog (keyword index). Combine this with the filter_bogus property on the widget and the widget will prepare the entered values.
It’s useless without a vocabulary, and setting enforceVocabulary true doesn’t really make sense unless you use the LinesField.
Configuration
There are a few parameters that can be set to alter the behavior of the widget:
- actb_timeout
How long (ms) before the autocomplete box times out and dissapears. (Default: 2500, -1 to disable)
- actb_lim
How many choices to show in the autocomplete box at a time. (default: 5)
- actb_firsttext
Should the autocomplete serach be limited to the beginning of keyword (True), or should it search the entire entry for a match (False)? (default: 0)
- actb_filter_bogus
remove keywords that are not in the vocabulary and also remove redundant keywords, leading/trailing spaces etc.
- actb_expand_onfocus
expand the dropdown on focus.
- actb_complete_on_tab
set to 0 if you want tab to move the focus to the next widget. (default: 1)
Credits
The javascript used is based on the widget at http://codeproject.com/jscript/jsactb.asp by zichun and used with permission.
The improved_multivalued_fields_management branch which has become the new trunk of this package was started by Quadra Informatique <plone at quadra-informatique dot fr>.
Thanks to all contributors (names listed in Changes).
Changes
1.3 (2010-03-15)
Added possibility to hide the clear button
Corrected a bug showing () when the multivalued field was empty
Added compatibility with reference fields
generalized a few checks to make compatible with ReferenceFields (davisagli)
inline the filter function and uses scopes instead of method calling. the vocab for field was being called for each term stored in the field keyword_from_value method should go away. It’s no longer being used. also general white space cleanups. (runyaga)
tabindex is not available for archetypes widgets anymore and broke edit views in plone4 - fixes http://plone.org/products/autocompletewidget/issues/5 (fRiSI)
eggified product (fRiSi)
history.txt and HISTORY.txt merged to CHANGES.txt
added issue #3 (merging with trunk) to todo.txt
removed refres.txt since it’s no longer supported
made widget work with vocabularies containing non-ascii characters too (fRiSi)
14-03-2008 - v1.2.1 : Jonathan Riboux
integrated Ak Sorpa’s fix to prevent &, < and > to appear in the input box after selecting a value in the drop-down list
12-03-2008 - v1.2 : Jonathan Riboux
corrected i18n attributes so AutocompleteWidget can be used in English
added tooltips and button labels
better look
added CSS classes to buttons
25-02-2008 - v1.1 : Nicolas Geissel
using fieldName var instead of field.getName for better flexibility (widget can now be used as a search widget)
added i18n
07-02-2008 - v1.0 : Jonathan Riboux
improvement of display list support (display value, but register key)
widget shows a list of current values next to the input field for multivalued fields
arrows navigation in menu now works on Internet Explorer
cleanup of process_form code
09-02-2005: Danny Bloemendaal
ESC shows the dropdown list
onblur now works and hides the list
added property to have the list expanded on focus
renamed filter_bogus to actb_filter_bogus to have a consistent naming
08-02-2005: Danny Bloemendaal
replaced the javascript factory with the latets version from the original author
redid the styling so the widget resembles more the standard widget formatting
removed some configuration stuff that only lead to bad UI behavior
added LinesField support so the field can now be indexed properly
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for Products.AutocompleteWidget-1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b97a942ecf825fe4c659996d964bad832972f654792ed42f7618ac170d8cfb5b |
|
MD5 | 1204812499ed9ebbb4fbe30bc45e2254 |
|
BLAKE2b-256 | 5ac83449a739bccc907d149d1cd15c4327ab6311509bf4a1a86698c55d180fe9 |
Hashes for Products.AutocompleteWidget-1.3-py2.6.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5e41e7e720ab1e154b74d468ed4fa1e2b441f41ac9ad306babb004c4626dc9f |
|
MD5 | 4d766accb83ab00d11aa5666aceb5797 |
|
BLAKE2b-256 | 0a3d851651e6dd62035e19a2b54b9cf5badcd729a5ae2804a16fa5fe8c440311 |
Hashes for Products.AutocompleteWidget-1.3-py2.4.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c81794d987dbb7c0140ab216279aeac915dede133f9a884b03984d1f889bbb63 |
|
MD5 | 41703d6c42aaec66ca819c4c18220868 |
|
BLAKE2b-256 | 1b2374f17b9c83ae8842f7745127002425ad9f662b0f72a7525b3d5e43cbb876 |