NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Ubaidullah on January 10, 2021, 12:05:10 AM

Title: Locator Type Starts-With returns blank browse
Post by: Ubaidullah 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.
Title: Re: Locator Type Starts-With returns blank browse
Post by: urayoan 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).



Title: Re: Locator Type Starts-With returns blank browse
Post by: Ubaidullah on January 11, 2021, 09:22:47 PM
Hi,

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

Regards,
Ubaidullah Nubar.
Title: Re: Locator Type Starts-With returns blank browse
Post by: Bruce 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