NetTalk Central

Author Topic: Filters and Locators Combined  (Read 3690 times)

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Filters and Locators Combined
« on: January 31, 2011, 05:20:38 AM »
Hi,

When having a browse with a filter in place the locator doesn't seem to work.
It doesn't matter what kind of filter, just having confgured one breaks the locator.

Any ideas?
Greetz,
Sjoerd

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Filters and Locators Combined
« Reply #1 on: January 31, 2011, 04:54:58 PM »
Maybe I can help here, I had the same problem and it was confusing the hell out of me, so here goes...

In the Before Browse loop routine you get this code just before 11 SetFilter.

  ThisView{prop:Filter} = loc:FilterWas
  Loc:LocatorValue = p_web.GetLocatorValue(Loc:LocatorType,'WBrowsePolicies',Net:Both)
  ! Start of "Browse Filter"

Here I play with the filters, and then copy those 2 lines at the bottom of my embedded source (probably because I'm too stupid to find the real embed point..)

Anyway, when rewriting the app for NetTalk5 I decided to use different procedure names so that they will not clash with names in the Desktop version.  Notice the 'W' in front of the procedure name.  I you're doing the same as me, just check the procedure name.

Cheers
Charl



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Filters and Locators Combined
« Reply #2 on: January 31, 2011, 10:09:52 PM »
What does your filter look like?
Have you hand-coded in the procedure?

Cheers
Bruce

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Re: Filters and Locators Combined
« Reply #3 on: February 01, 2011, 03:09:00 AM »
Bruce,

This is the handcoded filter:
I use the local loc:sqlfilter variable as the filter on the browse.

Code: [Select]
        loc:filter = ''
        loc:filter =  loc:filter & |
                        CHOOSE(loc:filter<>'' AND p_web.GSV('svLocVoornaam')<>'' ,' AND ','') & |
                        CHOOSE(p_web.GSV('svLocVoornaam')<>'', 'voornaam like ''%' & p_web.GSV('svLocVoornaam') & '%''', '')

        loc:filter =  loc:filter & |
                        CHOOSE(loc:filter<>'' AND p_web.GSV('svLocAchternaam')<>'' ,' AND ','') & |
                        CHOOSE(p_web.GSV('svLocAchternaam')<>'', 'achternaam like ''%' & p_web.GSV('svLocAchternaam') & '%''', '')

        loc:filter =  loc:filter & |
                        CHOOSE(loc:filter<>'' AND p_web.GSV('svLocDatum')<>0 ,' AND ','') & |
                        CHOOSE(p_web.GSV('svLocDatum')<>0, 'datum like ''%' & p_web.GSV('svLocDatum') & '%''', '')

        loc:filter =  loc:filter & |
                        CHOOSE(loc:filter<>'' AND p_web.GSV('svLocPostcodeUnique')<>'',' AND ','') & |
                        CHOOSE(p_web.GSV('svLocPostcodeUnique')<>'', 'postcodeunique like ''%' & p_web.GSV('svLocPostcodeUnique') & '%''', '')

        loc:filter =  loc:filter & |
                        CHOOSE(loc:filter<>'' AND p_web.GSV('svLocType')<>'',' AND ','') & |
                        CHOOSE(p_web.GSV('svLocType')<>'', 'type like ''%' & p_web.GSV('svLocType') & '%''', '')

        loc:filter = loc:filter & |
                        CHOOSE(loc:filter<>'',' AND ','') & |
                            ' PlaatsnaamId IN (SELECT PlaatsnaamId FROM PlaatsnaamRechten ' & |
                            'WHERE PlaatsnaamRechten.MedewerkerId=' & p_web.GSV('SV:MedewerkerID') & ')'
       
        db.debugout('browseNAW filter=' & loc:filter)
       
        if loc:filter <> '' then loc:sqlfilter = 'SQL(' & loc:filter & ')' .
Greetz,
Sjoerd

bergsj

  • Jr. Member
  • **
  • Posts: 81
    • MSN Messenger - swjvandenberg@hotmail.com
    • View Profile
    • Email
Re: Filters and Locators Combined
« Reply #4 on: February 01, 2011, 04:41:51 AM »
Problem solved...

Since I used linked tables I had to use {prop:alias} in my custom SQL() filters....

Greetz,
Sjoerd