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.
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).
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.
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
Do you store your SQL query in servoy or in your database?
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?
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.
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
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:
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:
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)
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.
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?
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