In find mode, valuelists show the entire contents of a table, irrespective of param filters, when Database Values are used.
Jim
In find mode, valuelists show the entire contents of a table, irrespective of param filters, when Database Values are used.
Jim
Jim,
I tried a small test and could not reproduce this.
Are you setting the tableFilterParam in the open-solution method?
Does it happen both in developer and client?
What servoy version are you running?
Rob
Global onLoad method:
var curForm = application.getMethodTriggerFormName();
var filterParam = forms[curForm].controller.addFoundSetFilterParam(‘pk_client’, ‘=’, globals.client_id);
forms[curForm].controller.loadAllRecords();
Applies to every form that the users may touch in any way.
Other than the anomaly described in my post, addFoundSetFilterParam has worked exactly as expected. This is the first time I have had a valuelist in find mode, however.
Happens in developer and client.
Servoy Developer
Version 3.1.3-build 407
Java version 1.5.0_06-64 (Mac OS X)
Jim
Jim,
I think that you should use databaseManager.addTableFilterParam in the solution opOpen method. It adds the condition for every query that touches the table.
Rob
Does this mean that Servoy does not recognize this problem as a bug, which will be fixed?
Or, are you suggesting that I add a table filter as an extra precaution while you fix the bug with the foundset filter?
Jim
Another bit of info: the relationship the valuelist uses is between a calculation in the contact table and a text field in the valuelist table.
If anyone else has had this problem or cares anyway, there are a couple of workarounds (other than Rob’s suggestion of adding a table filter):
In either case, the param filtering issue is side-stepped. That functionality is replicated methodically.
Still, a param filter really ought to work in find mode in any instance when it works in data mode, I would think. Otherwise, confidentiality of client records could be compromised.
Jim
p.s. if anyone has thoughts on the relative merits of 1) and 2) above, please do tell; (I’m thinking: the SQL method is more flexible, but then you have to fire it whenever the a valuelist is updated, too)
p.p.s. in any event, I see this as a happy accident, as I am able to get rid of a bunch of calculations, which seem more expensive than global variables… make sense?
What you want, valuelist showing only the data filtered by a filter param, can only be done by setting the table param filter. Not the foundset.
How do you know that that foundset is used for the valuelist? If you would load a different foundset into that form just before you set the foundset filter param. Then what would happen? It is just not reliable with foundset filter params.