Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autocomplete values (vocabulary?) for TokenInputFieldWidget #19

Open
jperals opened this issue Oct 9, 2012 · 9 comments
Open

Autocomplete values (vocabulary?) for TokenInputFieldWidget #19

jperals opened this issue Oct 9, 2012 · 9 comments
Assignees
Labels

Comments

@jperals
Copy link

jperals commented Oct 9, 2012

TokenInputFieldWidget is supposed to provide an autocomplete functionality that suggest values to the user as (s)he types, but where are these values fetched from?

In Dexterity, only fields of type Choice can have a vocabulary[1], but your readme[2] seems to say that the TokenInputFieldWidget can only be used with (a List of) TextLine fields.

I tried using Choice fields with the TokenInputFieldWidget instead of TextLine fields, and confirmed that it doesn't work.

[1] http://plone.org/products/dexterity/documentation/manual/developer-manual/advanced/vocabularies
[2] https://github.com/collective/collective.z3cform.widgets#new-fields

@ghost ghost assigned flecox Oct 11, 2012
@hvelarde
Copy link
Member

@flecox could you please check this?

@maethu
Copy link
Member

maethu commented Nov 19, 2012

@jperals Currently it's hardcoded in token_input_widget.py:

values = self.context.portal_catalog.uniqueValuesFor('Subject')
old_values = self.context.Subject()

@gborelli
Copy link

I've done something similar in this package:

Unfortunately it's not completed and well documented but it could be useful for you.
If you are interested in I can integrate this widget in c.z3cform.widgets package

@maethu
Copy link
Member

maethu commented Nov 19, 2012

@gborelli Thank you
But unfortunately I'm looking for a different behavior.
I have a vocabulary as source.
I'm trying to tweak the collective.z3cform.widgets, currently it's just a prove of concept. So I'm not sure, that we need the tokeninput widget.
And I do not use it for DX type, it's just a notification z3c form.

@hvelarde
Copy link
Member

@frapell any comments?

@ericof
Copy link
Member

ericof commented Apr 15, 2013

Adding more info here:

  1. The widget only supports the Subject (Tags) field. There isn't a way to use it with fields with vocabularies
  2. All keywords are loaded into the page. For instance, if you have a site with 5000 keywords, all of them will be listed inline in the edit view for the content item

@hvelarde
Copy link
Member

@maethu did you succeed on your proof-of-concept?

@maethu
Copy link
Member

maethu commented Apr 18, 2013

@hvelarde Unfortunately not.
I found select2 jQuery widget really useful and made a test implementation hier
I wrote my own small template
As source I defined a new vocabulary
It's well tested, but not production ready (some performance issues if the user source is a ldap user folder and other small issues)

It's possible to search groups/users and add new entries if you wand.

I wasn't able to implement it as a proper widget with vocabulary source.

@hvelarde
Copy link
Member

@maethu see #35

I think the JSON bowser view could be the key to support this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants