I am attempting to use a global method as the valuelist for a TYPE_AHEAD element on a form, but am having some trouble with it; currently, I have Servoy version 6.1
I connected to the example_data server and created a form using the “orders” table for the data source, selecting all fields in the form creation dialog. After creating the form, I changed the displayType for the employeeid element on the form to TYPE_AHEAD. Next, I opened the valueList dialog for this element, selected the Global method option, and clicked the dotted button to the right of the text box to create a new global method.
Next, I clicked the Scope button, which displayed a default name for the global method: getDataSetForValueList. I left the default name unchanged, and clicked the Create button. Finally, I clicked OK. The text box to the right of the Global method radio button was then filled in with the following text:
scopes.globals.getDataSetForValueList(displayValue,realValue,record,valueListName,findMode)
When I examined the sample code created by default for this method (by clicking the folder icon), I saw that it queried the employees table, selecting the employeeid and the concatenated first and last name. I saved the valueList that I created, calling it “employeesList”, and made sure that the TYPE_AHEAD element on my new “orders” form showed employeesList for its valueList property and that the dataProvider property for the element was set to “employeeid”.
I ran the solution in the Web Client, checking to make sure that the employee first and last name were changing as I navigated between orders. The problem was that when I attempted to type within the TYPE_AHEAD text box, I would see the list of employees appear for several seconds, but then the employee name that was originally selected for that record would overwrite what I was typing.
Am I misusing the global method valuelist in some way? Keep in mind that I did not change the sample code that Servoy automatically generated for the global method.
Thanks in advance to anyone who can help me.