Page 1 of 1

getValueListArray() how to get all values?

PostPosted: Wed Sep 19, 2018 11:08 pm
by pbdavis
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?

Re: getValueListArray() how to get all values?

PostPosted: Thu Sep 20, 2018 1:01 pm
by ROCLASI
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.

Re: getValueListArray() how to get all values?

PostPosted: Thu Sep 20, 2018 2:00 pm
by pbdavis
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.