FoxInCloud
dev / prod
Gravatar is a globally recognized avatar based on your email address. dev / prod
  Vincent H.
  All
  May 11, 2020 @ 10:55am

Hi Thierry,

I have an autocompletion control which works perfectly in development mode but not in production mode.
No error message, nothing in the Firefox console.
Do you have a clue to find the problem ?

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 11, 2020 @ 12:53pm

do you have the same data on both sides?

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 11, 2020 @ 01:50pm

Yes, I run the same program from the same context

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 11, 2020 @ 01:56pm

For ‘data’ I mean database tables

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 11, 2020 @ 02:01pm

Yes, exactly the same

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 11, 2020 @ 02:06pm

You can download the form state table and check the control’s Properties

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 11, 2020 @ 11:19pm

wACnLocalMax = 1

And it works in both modes

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 12, 2020 @ 12:13am

Is .rowSource a cursor or a table?

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 12, 2020 @ 12:16am

A cursor:

CREATE CURSOR CClients (Client C (240))

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 12, 2020 @ 12:35am

OK thanks
this cursor must be empty at .wcHTMLgen (not sure however why it's different in dev mode)

MODIFY CLASS awCboAutoComp OF aw method wcHTMLgen

&& replace
if Reccount(this.RowSource_) < this.wACnLocalMax

&& by
if Between(Reccount(this.RowSource_), 1, this.wACnLocalMax)

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 12, 2020 @ 01:03am

It doesn't work if this.wACnLocalMax = 1

if this.wACnLocalMax > 1 .AND. Between(Reccount(this.RowSource_), 1, this.wACnLocalMax)
Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 12, 2020 @ 01:18am

So your cursor cClient is not empty at .Load() and .wcHTMLgen()?

Contains 1 record?

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 12, 2020 @ 01:48am

yes, apparently necessary to activate it

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  Vincent H.
  May 12, 2020 @ 02:32am

I modified.
Finaly, it's also OK with:

if Between(Reccount(this.RowSource_), 1, this.wACnLocalMax)

... and cursor empty at Load()

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 13, 2020 @ 12:49am

OK thanks for the precision.

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 13, 2020 @ 08:10am

Normal.
To further improve this wonderful control, would it be possible to display (when found) only a portion of the indexed field ?
Example:
_5RM10ICOR Mr and Mrs. Jean DUPONT, residing in ...
Just SUBSTR (MyIndex, 12) like:
Mr and Mrs. Jean DUPONT, residing in ...
thanks in advance

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 13, 2020 @ 08:31am
define class myCboAutocomp as xxxCboAutocomp of xxx.vcx && or awCboAutocomp of aw.vcx
procedure Init_cCandTag
lparameters result as String && @

local cResult
cResult = dodefault(@m.result)
if !empty(m.cResult)
  this.wACcCandExpr = "SUBSTR(" + this.wACcCandExpr + ", 12)"
endif
return m.cResult
Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 13, 2020 @ 10:41am

Superb ! Thanks !

Before:

After:

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  Vincent H.
  May 16, 2020 @ 07:24am

Beautiful, but in Valid(), search no longer works:

seek this.Value in (this.RowSource_) order (this.wACcCandTag)

Logic, with this added:

this.wACcCandExpr = "SUBSTR(" + this.wACcCandExpr + ", 12)"

Do you have an idea ?

Thanks in advance

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 16, 2020 @ 08:13am

This requires more development;

I suggest you move your sys(2015) to the right of your expression so that it overflows when displaying the list.

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  Vincent H.
  FoxInCloud Support - Thierry N.
  May 16, 2020 @ 09:08am

Yes, we had the same idea. It's OK like that. Thanks

Gravatar is a globally recognized avatar based on your email address. re: dev / prod
  FoxInCloud Support - Thierry N.
  Vincent H.
  May 16, 2020 @ 09:12am

Generally, any table can have a candidate key that only depends on business data, without including a primary key

© 1996-2020