Difference between svySearch and Type_ahead in a field

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Difference between svySearch and Type_ahead in a field

Postby dfernandez » Wed Oct 18, 2023 8:39 pm

Hi,

Is there a way to configure type_ahead on a field to work like svySearch, to return values not necesary at the beginning of the dataprovider?
svySearch returns values on any part of the dataprovider but typeAhead only return the values that start with that text. You can use % at the beginning that that is not intuitive for end users.

Regards
dfernandez
 
Posts: 87
Joined: Wed Feb 29, 2012 4:04 pm

Re: Difference between svySearch and Type_ahead in a field

Postby paronne » Thu Oct 19, 2023 8:34 am

Hi,

yes, you can set this property either at element level, or at application level:

Code: Select all
// set only at element level
elements.typeahead.putClientProperty(APP_NG_PROPERTY.VALUELIST_CONTAINS_SEARCH, true);

// set globally for alll valuelist search
application.putClientProperty(APP_NG_PROPERTY.VALUELIST_CONTAINS_SEARCH, true);


the client property that can be set to always do a like search when filtering over valuelist on a typeahead like component. So a component that has a valuelist as a property and uses user input to search in that valuelist. By default it uses a like search with a % at the end (startsWith search on the fields of the valuelist). But this makes it a like %value% so a contains search. This can be set on the element (element.putClientProperty() or on a application wide level (application.putClientProperty()) DEFAULT: false




Regards,
Paolo
paronne
 
Posts: 203
Joined: Fri Nov 02, 2012 3:21 pm

Re: Difference between svySearch and Type_ahead in a field

Postby dfernandez » Thu Oct 19, 2023 3:56 pm

Thank you!
Works perfect.

I could not find this in the documentation for typeAhead
dfernandez
 
Posts: 87
Joined: Wed Feb 29, 2012 4:04 pm

Re: Difference between svySearch and Type_ahead in a field

Postby sean » Thu Oct 19, 2023 4:03 pm

Hmmm, It is buried in reference doc:
https://docs.servoy.com/reference/servo ... ins_search

...But we are right now working on a Value List guide. Will make a note to mention this one! Thanks for the feedback.
Software Engineer
Servoy USA
sean
 
Posts: 370
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: Difference between svySearch and Type_ahead in a field

Postby robert.edelmann » Tue Oct 24, 2023 9:06 am

When you look at valuelists, can you look at an option to keep the sort of manually created valuelists when using svyPopupFilter?
mit freundlichen Grüßen
Robert Stefan Edelmann
User avatar
robert.edelmann
 
Posts: 95
Joined: Wed Aug 14, 2013 6:12 pm


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 32 guests