Global Method Valuelist not updated

I have a valuelist that is populated through a global method which uses a stored calculation field. When I change a value that is used for the valuelist the value doesn’t change in the valuelist display. It does correctly change in the calc field (I checked the DB).

Does a valuelist store it’s display data in memory? How can I force the valuelist display data to be updated?

Kaptan:
Does a valuelist store it’s display data in memory? How can I force the valuelist display data to be updated?

I assume you mean you populate the valuelist using ```
application.setValueListItems(params)


You have to see this as a valuelist using 'custom values', in other words: the valuelist will be static until you populate it again...

If you want the valuelist to change with the dataProvider, you should consider basing your valuelist on (relation +) this dataProvider.
Only thing is that valuelist behaviour can become a bit odd when the database contains to much records...

Hope this will clarify your problem.

Thanks Marc,
I am indeed populating the valuelist with custom values, but through a global method which holds the queries for the display- and realvalues.
I see that the valuelist is static until the valuelist is populated again, but this is where my ‘problem’ arises. I don’t populate the custom values myself, I’ve just selected the Global Method option in the valuelist. Probably the global method gets fired just once and the values stay static. I should probably repopulate it manually…

Kaptan:
I’ve just selected the Global Method option in the valuelist. Probably the global method gets fired just once and the values stay static. I should probably repopulate it manually…

I see, wasn’t even aware of this possibility as we have a couple of tables which do take care of all the valuelists.

Anyway, looking at your approach:
I let Servoy create the global method from the valuelist editor, and the comment says: ‘Called when the valuelist needs data.’
This can mean 2 things: it’s called the first time the valuelist needs it’s data OR it’s called every time the valuelist needs it’s data…
From your experience I’d say it’s the first one :-(

You might consider to do some rework on populating your valuelists, so you can do everything with just 1 piece of code (everything: first time init + repopulate)
This is at least what I’d prefer…

A global method valuelist is called for every record change, or if you use a typeahead then it is also called for a keystroke a user makes (display param is set)
or if a value is set for that dataprovider and the valuelist doesnt have that (real)value cached then it will ask the global method for its value (real param is set)

But if there are no such changes (so no record change, no user input on a typeahead and no dataprovider = X call) then the global method will be cached.
Else it would be called all the times