NetTalk Central

Author Topic: Locator Type Starts-With returns blank browse  (Read 2024 times)

Ubaidullah

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Locator Type Starts-With returns blank browse
« on: January 10, 2021, 12:05:10 AM »
Hi Bruce,

In a NetWebBrowse, I set the Locator Type of a column to "Starts-With" in the Sort tab of the column.

The browse shows correctly when the locator is blank. But as soon as I type anything, the browse goes blank.

The SQL code being sent has this WHERE clause when I type 'A' in the locator:

WHERE D.NAME >= 'A' AND D.NAME <= 'A'

Which obviously returns no results. This should be:

WHERE D.NAME like 'A%'


What am I doing wrong and how can I fix it?

ps. Is there an example for SQL that I can use to showcase SQL related issues?

Regards,
Ubaidullah Nubar.

urayoan

  • Full Member
  • ***
  • Posts: 222
    • View Profile
    • AZ Rock Radio
Re: Locator Type Starts-With returns blank browse
« Reply #1 on: January 11, 2021, 07:30:26 AM »
Hi:
  Try this in your code at template level and check this solves the problem.
  First, check in the sort tab if you have set the default locator field (check screenshot). Select the field that does apply in your case.

Then, int he locate tab, set the locator type to your needs (check screenshot).




Ubaidullah

  • Full Member
  • ***
  • Posts: 123
    • View Profile
Re: Locator Type Starts-With returns blank browse
« Reply #2 on: January 11, 2021, 09:22:47 PM »
Hi,

Thanks for the suggestion.
I did as suggested. No difference.

Regards,
Ubaidullah Nubar.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11186
    • View Profile
Re: Locator Type Starts-With returns blank browse
« Reply #3 on: January 13, 2021, 10:51:35 PM »
Hi Ubaidullah,

>> WHERE D.NAME >= 'A' AND D.NAME <= 'A'

actually what it creates is

>> WHERE D.NAME >= 'A' AND D.NAME <= 'A<254>'

the code is "database neutral" so doesn't translate to the SQL LIKE command. (at least not yet).

the code is in netweb.clw in the MakeFilter method. You might experiment with replacing <254> with a hyphen ( - ) as this is char<126> and so would survive any translation to utf-8.
Let us know if that works.

Cheers
Bruce