TWebEditAutocomplete with HTML Template = error on doautocomplete

Hi,
I'm using already in pure webform project TWebEditAutocomplete without issue.
Now, I'm trying to integrate it in an HTML Template.
Unfortunately, I get an error during FormCreate I guess

index.html:81 Uncaught SyntaxError: Unexpected token '-'
at Object.AddScript (WEBLib.EditAutocomplete.pas:451:1)
at Object.UpdateElement (WEBLib.EditAutocomplete.pas:614:3)
at Object.SetShowFocus (WEBLib.Controls.pas:2628:5)
at Object.CreateInitialize (WEBLib.StdCtrls.pas:2182:3)
at Object.CreateInitialize (WEBLib.EditAutocomplete.pas:220:3)
at Object.CreateWithID (WEBLib.Controls.pas:1978:3)
at Object.Create$2 (WEBLib.Controls.pas:1679:3)
at c.$create (rtl.js:332:1)
at Object.LoadDFMValues (Form_AutoComplete.pas:72:41)
at Object.DoCreate (WEBLib.Forms.pas:2687:3)
rtl.js:266 Uncaught ReferenceError: doautocomplete is not defined
at Object.UpdateElement (WEBLib.EditAutocomplete.pas:747:1)
at Object.SetShowFocus (WEBLib.Controls.pas:2628:5)
at Object.CreateInitialize (WEBLib.StdCtrls.pas:2182:3)
at Object.CreateInitialize (WEBLib.EditAutocomplete.pas:220:3)
at Object.CreateWithID (WEBLib.Controls.pas:1978:3)
at Object.Create$2 (WEBLib.Controls.pas:1679:3)
at c.$create (rtl.js:332:1)
at Object.LoadDFMValues (Form_AutoComplete.pas:72:41)
at Object.DoCreate (WEBLib.Forms.pas:2687:3)
at Object.Create$5 (WEBLib.Forms.pas:2843:3)

TWebEditAutoComplete elementid is targeting an DIV in HTML page as describe in documentation

This happens with debug and release modes

Any idea about root cause ?

I retested this here but could not see an error.
Do you use latest version v2.4.0.0 of TMS WEB Core?

Hi Bruno,

I was using web 2.3.2, but updating to 2.4.0 didn't improve behaviour
If you are right I can send you directly the test project

If the problem persists, send a test project in which this issue is isolated.

Hi Bruno

Test project sent in Private Message

I followed up via pm

Issue is confirmed to be linked to usage of "-" in ID string from DIV object in DOM.
Replacing by "_" fixes the issue.

Thanks Bruno

Warning
Using TWebEditAutocomplete is HTML template request to consider the list build by component will use left bottom of parent DOM object to display
So don't forget to include DIV for TWebEditAutoComplete into another DIV that will be used to define the top left of the list auto generated by component

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.