Problems with dynamic value list not displaying values

Using a method that creates arrays from the results of SQL queries and that is attached to the onRecordSelected event, I am populating 3 value lists attached to 3 comboboxes on a form. While the valuelists themselves are created properly, the form does not seem to be able to display the matching values in the 2nd or 3rd combobox. It seems like the method doesn’t have enough time to finish populating the value lists before the form wants to display itself.

Here is more detail. I have a table called ‘persons’ where a person’s first and last name are stored. I have another table called ‘contacts’ where a person_sn and a client_sn can be matched to make a contact for a client. Contact records also store flags indicating that a contact can be selected as a job contact, a bill-to contact and/or a ship-to contact. I have a third table called ‘quotes’ that stores contact_sn’s for a quote’s job contact, bill-to contact and ship-to contact. When a user clicks on the combobox for a quote contact, the choices should be limited to contacts that are appropriate for the type of contact (i.e. click on job contact and only contacts for that quote’s client that are flagged to be included as job contacts appear). Normally, I would use a relationship to build this value list, however I want only the contact’s name to appear in the value list and only the contact_sn to be returned to the dataprovider, and the name isn’t stored in the ‘contacts’ table, its in the ‘persons’ table.

As I said, the value lists themselves are created correctly, but even though there are contact_sn’s stored in the quote’s contacts dataproviders and those contact_sn’s do match values present in the value list, the matching names only display in the first combobox and not the second or third. It seems like a timing issue to me. Attached is a sample solution.

Thanks in advance,
Steve in LA

051018_value_list_bug.servoy (73.6 KB)

Hai Steve,

Where is the attached solution?

And, which version of servoy are you using?

Sorry. Had to delete the sample to remove some secure data. Will be back up in a few minutes.

I’m using Servoy 2.2.1rc3

Ok. Sample solution is now attached. Smaller download to boot! Sorry about that. In the process, I got the notice that 2.2.1 is now available, so I will upgrade and try it out.

Steve in LA

Hai Steve, I see 2 out of 3 popups filled with the correct value. Taking one out makes the other 2 appear with the correct value.

I do something similar but only with one valuelist in my solution. That gave me some trouble too. I am not sure this is fully supported/possible with 3 lists. What comes first?.. Can you set the valuelist before you show the form?

Version 2.2.1 fixes this problem. Boy, if I had only slept in for an extra hour this morning, I would have upgraded first before posting. I guess the early bird does indeed get the worm. Mmmmm…worms.

Steve in LA