getValueListArray() how to get all values?

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

getValueListArray() how to get all values?

Postby pbdavis » Wed Sep 19, 2018 11:08 pm

When calling getValueListArray() I only get the first 500. I need an array of all the values. How can I get all the values in the valuelist in an array?
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA

Re: getValueListArray() how to get all values?

Postby ROCLASI » Thu Sep 20, 2018 1:01 pm

Hi Paul,

Valueslists that are defined on top of a table will only load max 500 rows at a time. This is to not blow up your memory usage and it's also bad UX to have dropdown that have so many rows (except for typeahead).
Why do you need all the values? Can't you just query the value from the underlying table? This is way more efficient with large tables.

Hope this helps.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Mastodon: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5438
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: getValueListArray() how to get all values?

Postby pbdavis » Thu Sep 20, 2018 2:00 pm

I'm using a TYPE_AHEAD control. Is there a way to get typeahead for see all the data?

Ok, I've resolved my issue. The code I inherited is using an empty valuelist then using getValueListArray() to read the first 500 for each type of item. Then filling the empty valuelist with setValueListItems(). So, this valuelist if dynamically used and limited to 500, depending on which item the user selects. I'm going to create a new field for each item and create a valuelist for each that directly uses its table. Then switch visible property to the field the user selected. This way the typeahead will work for the whole table. Thanks, @Roclasi for your help.
Paul Davis
Belcan Engineering Group, LLC
pbdavis
 
Posts: 60
Joined: Thu Nov 30, 2017 5:40 pm
Location: Florida, USA


Return to Programming with Servoy

Who is online

Users browsing this forum: Bing [Bot] and 5 guests