Typeahead + Custom List?

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

Typeahead + Custom List?

Postby john1598360627 » Thu Jan 11, 2024 2:30 am

I'm trying to create an email system. One aspect of emails is having a type ahead for addresses, such that you can find and add and remove multiple addresses to send to. What is the best way of achieving this in Servoy?

The only idea I have is by having a type ahead and a custom list separate, and then the type ahead feeds in new additions to the custom list. That should be possible, right?

Or, is there another component better suited for this that I'm not realizing?
john1598360627
 
Posts: 175
Joined: Tue Aug 25, 2020 3:03 pm

Re: Typeahead + Custom List?

Postby mboegem » Thu Jan 11, 2024 11:25 am

Hi,

nice and easy options would be to use the select2tokenizer component (Servoy Extra Components package), you can bind this to a valuelist.
The valuelist can get its values through a global method (so select that option in the valuelist editor), when you create the global method from the valuelist editor, a sample method is provided.
The global method can retrieve values in multiple ways: find/search, query, querybuilder. You can pick whatever you're most comfortable with.

The dataprovider that you bind to the component will get a line separated string of entries.
So an array would be retrieved easily like this: <myDataprovider>.split('\n')

The result looks like this, but can be fully customised using css:
tokenizer.png
example
tokenizer.png (12.83 KiB) Viewed 671 times


Hope this helps
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1752
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Typeahead + Custom List?

Postby john1598360627 » Fri Jan 12, 2024 1:33 am

mboegem wrote:Hi,

nice and easy options would be to use the select2tokenizer component (Servoy Extra Components package), you can bind this to a valuelist.
The valuelist can get its values through a global method (so select that option in the valuelist editor), when you create the global method from the valuelist editor, a sample method is provided.
The global method can retrieve values in multiple ways: find/search, query, querybuilder. You can pick whatever you're most comfortable with.

The dataprovider that you bind to the component will get a line separated string of entries.
So an array would be retrieved easily like this: <myDataprovider>.split('\n')

The result looks like this, but can be fully customised using css:
tokenizer.png


Hope this helps

Ah, yeah that seems perfect! Thanks I'll try and set that up.
john1598360627
 
Posts: 175
Joined: Tue Aug 25, 2020 3:03 pm


Return to How To

Who is online

Users browsing this forum: No registered users and 23 guests

cron