Form Input-Global Value List

Questions and answers for designing and implementing forms in Servoy

Form Input-Global Value List

Postby jehanzeb » Sun Sep 10, 2017 6:35 am

I have three tables i.e. Regions, Countries and Cities all related correctly.
I am designing a form with three combo boxes to input Regions, Countries and Cities. For obvious reasons, I have chosen to use a global table with global_value_list for each box.
But I would also like to filter the two comboboxes i.e.Countries and Cities combos to display filtered lists instead.
I mean countries list should display according to selected Region and Cities list should be filtered according to Country selected.

Regrettably, I am new to servoy and if the questions eems below standard, my apologies in advance. Help, of course shall be much appreciated.
jehanzeb
 
Posts: 1
Joined: Sun Sep 10, 2017 6:24 am

Re: Form Input-Global Value List

Postby sean » Mon Sep 11, 2017 5:49 pm

Hi,

It should be possible. You can base countries on countries table. Then you can base regions and cities on relations.
This approach requires no code, but the challenge with this setup, is that these (non-global) relations only works on the context of the form's selected record.

So what does the record that you edit look like?
Does it have FKs or relations to the tables ?
i.e. "order_to_ccountries.countries_to_regions" etc

Another approach requires just a little code.
handle the onDataChange (and maybe onRecordSelection) event to update the valuelists.
use
Code: Select all
elements.my_element.setValueListItems(jsDataSet/Array)

or
Code: Select all
application.setvalueListItems('my_value_list',jsDataSet/array)
Software Engineer
Servoy USA
sean
 
Posts: 85
Joined: Mon May 21, 2007 6:26 pm
Location: USA


Return to Forms

Who is online

Users browsing this forum: No registered users and 1 guest