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 ?
do you have the same data on both sides?
Yes, I run the same program from the same context
For ‘data’ I mean database tables
You can download the form state table and check the control’s Properties
wACnLocalMax = 1
And it works in both modes
Is .rowSource
a cursor or a table?
A cursor:
CREATE CURSOR CClients (Client C (240))
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)
It doesn't work if this.wACnLocalMax = 1
if this.wACnLocalMax > 1 .AND. Between(Reccount(this.RowSource_), 1, this.wACnLocalMax)
So your cursor cClient
is not empty at .Load()
and .wcHTMLgen()
?
Contains 1 record?
yes, apparently necessary to activate it
I modified.
Finaly, it's also OK with:
if Between(Reccount(this.RowSource_), 1, this.wACnLocalMax)
...
and cursor empty at Load()
OK thanks for the precision.
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
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
Superb ! Thanks !
Before:
After:
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
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.
Yes, we had the same idea. It's OK like that. Thanks