FoundSetFilterParam - Empty Data on subsequent form openings

Questions and answers for designing and implementing forms in Servoy

FoundSetFilterParam - Empty Data on subsequent form openings

Postby bobm » Fri Sep 30, 2016 2:43 pm

I'm using the addFoundSetFilterParam in the onLoad event so that filters the so that the data displayed is only some records.

foundset.addFoundsetFilterParam("table_id", ">",1234

The form opens fine the first time, when I go back to that form later the data is empty.
I'm sure the resolution would be to put the filer someplace else, I'm just not sure where?

Thanks,
Bob
Bob Mezzadri
EyeCOR By Nteon
bobm
 
Posts: 81
Joined: Thu Dec 29, 2011 8:24 pm

Re: FoundSetFilterParam - Empty Data on subsequent form open

Postby mboegem » Fri Sep 30, 2016 3:07 pm

Hi Bob,

pls have a look here:
https://wiki.servoy.com/display/public/DOCS/JSFoundSet#JSFoundSet-addFoundSetFilterParam(dataprovider,operator,value)

Add a filter parameter that is permanent per user session to limit a specified foundset of records. Use clear() or loadAllRecords() to make the filter effective. Multiple filters can be added to the same dataprovider, they will all be applied.


So I wouldn't place that in the onLoad, but rather do that upfront, then call clear() / loadAllRecords(), then goto the form.
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1742
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: FoundSetFilterParam - Empty Data on subsequent form open

Postby bobm » Fri Sep 30, 2016 4:42 pm

Thank you once again Marc!
Bob
Bob Mezzadri
EyeCOR By Nteon
bobm
 
Posts: 81
Joined: Thu Dec 29, 2011 8:24 pm

Re: FoundSetFilterParam - Empty Data on subsequent form open

Postby Bernd.N » Fri Sep 30, 2016 6:05 pm

We use foundsetFilterParam a lot and found it very powerful. We call it right after the user logged in in our onOpen() method.
There should be an index on the field that it filters to speed things up.

One has to hold in mind that directSQL still can access the data.
It is not a good idea to use the "IN array" construct when the array is very large, that slows down the app very much.
But using "ID IN select-expression" is very fast when the select works on an indexed field.
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 544
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany


Return to Forms

Who is online

Users browsing this forum: No registered users and 3 guests

cron