Archetypes autocomplete widget with support for String-, Lines- and ReferenceFields
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.
There are a few parameters that can be set to alter the behavior of the widget:
- How long (ms) before the autocomplete box times out and dissapears. (Default: 2500, -1 to disable)
- How many choices to show in the autocomplete box at a time. (default: 5)
- 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)
- Remove keywords that are not in the vocabulary and also remove redundant keywords, leading/trailing spaces etc.
- Expand the dropdown on focus.
- Set to 0 if you want tab to move the focus to the next widget. default is 1.
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).
- Use png icons instead of gif ones (Plone 4.3 compatibility). [thomasdesvenain]
- We can set as false a parameter on widget: actb_multivalued_adding_is_required, so that if user hasn’t clicked ‘add’ button on a multivalued field, current input is considered as a new value. Improves user experience when vocabulary is not enforced. [thomasdesvenain]
- Added a property in site_properties to define custom separators. “,” is set as a custom separator by default. “;” is always a separator. [thomasdesvenain]
- Fixed: was unusable out of the box with default sunburst theme. [thomasdesvenain]
- Consider, by default, lines fields as multiValued fields. [thomasdesvenain]
- Merged from trunk, keeping fixes and features [Quadra Informatique - jriboux]
From 1.0 original trunk
- Fixed safari keyboard issues. Added single select option [dannyb]
- Updated to use a GenericSetup profile for installation [wichert]
- Change the templates to use a div based dropdown, giving a sane scrolling experience. [dannyb]
- 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)
2008-03-14 - v1.2.1 : Quadra Informatique - 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
2008-03-12 - v1.2 : Quadra Informatique - Jonathan Riboux
- corrected i18n attributes so AutocompleteWidget can be used in English
- added tooltips and button labels
- better look
- added CSS classes to buttons
2008-02-25 - v1.1 : Quadra Informatique - Nicolas Geissel
- using fieldName var instead of field.getName for better flexibility (widget can now be used as a search widget)
- added i18n
2008-02-07 - v1.0 : Quadra Informatique - 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
2005-02-09: 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
2005-02-08: Danny Bloemendaal
- 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
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size Products.AutocompleteWidget-1.5.0.tar.gz (18.8 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for Products.AutocompleteWidget-1.5.0.tar.gz