Contents:
Introduction
News blog
What is Servoy?
Getting Started
Comparison Servoy/VFP
Performance
How-To's
Code Reference
VFP2Servoy Toolkit
Contact / feedback
|
How to create and use a global table for all valuelist items
In the previous walkthrough we created and applied a valuelist from a table. Now we could create
many tables to support all valuelist needs but there is a smarter way.
If you would want to setup a global table for all valuelist items and filter on the valuelist in
specific controls then that's pretty easy too.
This walkthrough is basically the same as the Table-based valuelist with a few exceptions.
Instead of creating a countries table you would want to create a table such as global_valuelist with the following fields:
Pay special attention to the field valuelist_name! It is very important to use exactly the same fieldname because this is what you will
be filtering on.
- Create a maintenance form as we did in the previous sample
- Run the form and add some test data
- Select the countries valuelist we created earlier
- Doubleclick it
- Change the Table Values item from test.countries to test.global_valuelist
- Check the Apply valuelist name as filter on column 'valuelist_name' checkbox
- Change the column settings accordingly to the screenshot below
- Change the sorting as desired to the code field or the description field
IMPORTANT! Note that the name of the valuelist (countries) is case-sensitive when applied as a filter. So if your table contains
the valuelist_name 'countries' the name of your valuelist should also be 'countries' and not 'Countries'.
Next we want to add a combobox to our form that use the valuelist:
- From the toolbar click the textbox button
- Select the country field from the customer table and press Ok
- Select the country textbox control in your form
- Change the displayType property to COMBOBOX
- Fill the valuelist property with the countries valuelist you just made
- Set the horizontalAlignment property to LEFT
- Run the form

Conclusion
As you can see we now have both the gender and countries valuelist definitions stored in the global_valuelist table.
Adding all of our valuelist definitions here will save huge amounts of time!
|
External resources:
vfp plugin
ServoyWorld 2012 pics
Official Servoy website
Ken Levy on Servoy
Servoy info
Servoy Forum
Servoy Documentation
|