# addTableFilterParam and servoy database valueLists

**URL:** <https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482>\
**Category:** Classic Servoy\
**Created:** [July 6, 2005, 8:18am UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482 "2005-07-06T08:18:53Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![olivier\_melet](https://avatars.discourse-cdn.com/v4/letter/o/ba8739/32.png) [@olivier\_melet](https://forum.servoy.com/u/olivier_melet)\
**Post date:** [July 6, 2005, 8:18am UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/1 "2005-07-06T08:18:53Z")

</div>

This is currently a major issue to us:

Servoy database valueLists do NOT take care of filters added by addTableFilterParam, which means that masked (filtered) data appears in servoy managed lists.  
Is this something you can correct?

As a matter of fact, in most cases, it is possible to create specific relations (with the related issue of not being able to specify litterals in the left part of the relation definition) as a workaround. But this workaround is rather complicated and as such a big source of bugs in a very sensitive domain: confidentiality of data.

As we are in the process of soon releasing beta test versions of several solutions we would greatly appreciate an official answer to the following:

Do you plan to apply filters to servoy managed valuelists?  
If yes, in which time frame?

If no, do you consider to make available the possibility to have litteral expressions as left part of relations instead of being forced to use preset globals?

Taking care of this issue will let us save a LOT of time in developpment and debugging, while renforcing the trust level of servoy.

---

<div class="post-metadata">

**Author:** ![JDW](https://avatars.discourse-cdn.com/v4/letter/j/dbc845/32.png) [@JDW](https://forum.servoy.com/u/JDW)\
**Post date:** [July 15, 2005, 9:16pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/2 "2005-07-15T21:16:41Z")

</div>

Hi,

If you do apply table filters to value lists, can you please allow that to be developer-selected in some fashion so the current functionality is retained as well (ie: where filters to not apply to value lists).

As it is it’s working very well for us.

Thanks.

JDW

---

<div class="post-metadata">

**Author:** ![ngervasi](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@ngervasi](https://forum.servoy.com/u/ngervasi)\
**Post date:** [July 17, 2005, 1:41pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/3 "2005-07-17T13:41:13Z")

</div>

Try to populate the value lists by SQL query, it is faster, you get rid of a lot of relations and globals, your code will be easier to mantain and you have full control over all.

---

<div class="post-metadata">

**Author:** ![megaquests](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@megaquests](https://forum.servoy.com/u/megaquests)\
**Post date:** [July 18, 2005, 8:29am UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/4 "2005-07-18T08:29:20Z")

</div>

> Try to populate the value lists by SQL query, it is faster, you get rid of a lot of relations and globals, your code will be easier to mantain and you have full control over all.

This sounds good, do you know of any documentation for this?  
We also have been having a lot of fun with filters and related valuelists ![:wink:]( "Wink")

Do you store your SQL query in servoy or in your database?

Many thanks

---

<div class="post-metadata">

**Author:** ![olivier\_melet](https://avatars.discourse-cdn.com/v4/letter/o/ba8739/32.png) [@olivier\_melet](https://forum.servoy.com/u/olivier_melet)\
**Post date:** [July 18, 2005, 8:40am UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/5 "2005-07-18T08:40:46Z")

</div>

Thank you everybody, as a matter of fact, most of our lists are populated through queries.

What we need now is an answer from servoy team, in order to know if we have to change the rest of our lists (an estimated 40 plus hours of work) or to wait for a fix.

Please, can somebody from servoy team give us an advice? Will you correct this or not?

Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [July 18, 2005, 9:33am UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/6 "2005-07-18T09:33:58Z")

</div>

The current behaviour is intentional, we cannot change this in 2.2 anymore, we will add a checkbox on a dbvaluelist to leave it to you if tableparameters are applied to a dbvaluelist.

---

<div class="post-metadata">

**Author:** ![ngervasi](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@ngervasi](https://forum.servoy.com/u/ngervasi)\
**Post date:** [July 18, 2005, 10:27am UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/7 "2005-07-18T10:27:17Z")

</div>

> megaquests:  
> This sounds good, do you know of any documentation for this?  
> We also have been having a lot of fun with filters and related valuelists ![:wink:]( "Wink")
> 
> Do you store your SQL query in servoy or in your database?
> 
> Many thanks

I use on onShow method to popultate the value lists as soon as the form is displayed, take a look at these functions:

setValueListItems()  
getDataSetByQuery()

The SQL query can be a static one or can be built dinamically from globals and field values:

```auto
var query1 = 'select distinct categoria from articoli order by categoria asc';
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query1, null, 10000);
application.setValueListItems('selector_categoria',dataset)

```

or:

```auto
		var query1 = 'select distinct categoria from articoli'
		if (globals.selector_marca || globals.selector_modello ||globals.selector_specifiche)
		{
			query1 +=' where '
		} 
		if (globals.selector_marca)
		{
			query1 += 'marca like "'+globals.selector_marca+'" &&'
		}
		if (globals.selector_modello)
		{
			query1 += ' modello like "'+globals.selector_modello+'" &&'
		}
		if (globals.selector_specifiche)
		{
			query1 += ' report_spec like "'+globals.selector_specifiche+'" '
		}		
		if ( utils.stringRight(query1, 2) == '&&' )
		{
		query1 = utils.stringLeft(query1, query1.length - 3)
		}
		query1 += ' order by categoria asc'

var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query1, null, 10000);
application.setValueListItems('selector_categoria',dataset)

```

---

<div class="post-metadata">

**Author:** ![olivier\_melet](https://avatars.discourse-cdn.com/v4/letter/o/ba8739/32.png) [@olivier\_melet](https://forum.servoy.com/u/olivier_melet)\
**Post date:** [July 18, 2005, 11:37am UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/8 "2005-07-18T11:37:52Z")

</div>

> Jan Blok:  
> The current behaviour is intentional, we cannot change this in 2.2 anymore, we will add a checkbox on a dbvaluelist to leave it to you if tableparameters are applied to a dbvaluelist.

Many thanks Jan, this will be a great feature!

While we’re at valuelists, I also have an other idea (which I will develop in a feature request) as we also use dynamic list changed by local context: the ability to link a list ‘constructor’ method to any field through a property like onShowList… It would be more effective than reconstructing the list onDataChange from other fields.

(see: [http://forum.servoy.com/viewtopic.php?p=23570#23570](http://forum.servoy.com/viewtopic.php?p=23570#23570) )

---

<div class="post-metadata">

**Author:** ![megaquests](https://avatars.discourse-cdn.com/v4/letter/m/dec6dc/32.png) [@megaquests](https://forum.servoy.com/u/megaquests)\
**Post date:** [July 19, 2005, 10:22pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/9 "2005-07-19T22:22:38Z")

</div>

many thanks Nicola

this went over my head a little but makes total sense to our sql developer so many thanks ![:D]( "Very Happy")

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [August 11, 2006, 11:45am UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/10 "2006-08-11T11:45:44Z")

</div>

We made “applying the tablefilter on all database valuelists” the default behaviour in Servoy 3.0rc1

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [August 11, 2006, 12:05pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/11 "2006-08-11T12:05:25Z")

</div>

Jan , this is fantastic news!

i’m just curious, i read some more features in the forum that wasn,t mentioned by the release topic of rc1. Also this one. Why?

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [August 11, 2006, 12:58pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/12 "2006-08-11T12:58:25Z")

</div>

It seems we forgot to mension one or two

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [August 11, 2006, 1:07pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/13 "2006-08-11T13:07:37Z")

</div>

Yes, for example this: in Servoy 3 you can show or hide fields in table view. That allows you to put for example 100 fields in a table view, hide 90 of them and give the user a popup menu with the hidden fields. The user selects a hidden field and voila, the field shows in the table view.

This is a REALLY nice addition because it makes typical list views a lot more flexible.

I wonder if this great addition could also make it to Servoy 2.2.6?

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [August 11, 2006, 1:45pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/14 "2006-08-11T13:45:35Z")

</div>

Well that one is mentioned in one of the release notes before rc1, if this feature is very important for you or your customer let us know and we might merge it back to the 2.2.x releases

---

<div class="post-metadata">

**Author:** ![patrick](https://avatars.discourse-cdn.com/v4/letter/p/b2d939/32.png) [@patrick](https://forum.servoy.com/u/patrick)\
**Post date:** [August 11, 2006, 1:48pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/15 "2006-08-11T13:48:53Z")

</div>

If that’d be possible I’d be really happy!!

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [August 11, 2006, 2:20pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/16 "2006-08-11T14:20:06Z")

</div>

Oh YES, please! ![:D]( "Very Happy")

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [August 14, 2006, 6:31am UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/17 "2006-08-14T06:31:58Z")

</div>

Mmm, I thought I was a very good reader of Releas eNotes, but that one I missed!

Very nice!

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [September 12, 2006, 1:39pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/18 "2006-09-12T13:39:12Z")

</div>

I have the idea that tableFilters are not taken into account on valuelists attached to Type Ahead fields in the latest 3.0 build.

Paul

---

<div class="post-metadata">

**Author:** ![Jan\_Blok](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@Jan\_Blok](https://forum.servoy.com/u/Jan_Blok)\
**Post date:** [September 13, 2006, 1:23pm UTC](https://forum.servoy.com/t/addtablefilterparam-and-servoy-database-valuelists/4482/19 "2006-09-13T13:23:40Z")

</div>

will be fixed in Servoy 3.0rc5
