NetTalk Central

Author Topic: AutoComplete Not Working  (Read 5541 times)

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
AutoComplete Not Working
« on: February 16, 2014, 06:10:45 PM »
Hi Bruce,

AutoComplete isn't working as expected in NT7.31 in C8 and C9. I've updated web67.app (C9):

1) Update Software > Download: Set to use the 'Websites' table for AutoComplete - AutoComplete doesn't show any values from the Websites table.
2) Add a record into 'More Assignments', something like: Set: LOC:Rating = WEB:Rating. There is a trace statement that should show the rating number in debugview but the assignment isn't made.
3) Add a 'Description' value, try: clip(WEB:Site) &' ('& WEB:SysID &')'. The app does not build in C9. A web app with the same sort of 'Description' value will build in C8 without any errors.
4) Add a different 'Description' value, try: WEB:SysID. The Description does not show.

Maybe I'm doing something wrong?

Regards,
Trent

[attachment deleted by admin]

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: AutoComplete Not Working
« Reply #1 on: February 20, 2014, 04:31:20 PM »
bump

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: AutoComplete Not Working
« Reply #2 on: February 25, 2014, 02:42:08 PM »
bump again - can anyone help please? I need this working asap.

Regards,
Trent

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: AutoComplete Not Working
« Reply #3 on: March 03, 2014, 11:57:11 PM »
1.
----
a) WebSites table needs a (unique) key on the SITE field.

b) For SOF:Download field, Autocomplete tab, Set Description field to Web:Site

2.
---
change your trace statement from
p_web.Trace('Website Rating = '& LOC:Rating)
to
p_web.Trace('Website Rating = '& p_web.GetSessionValue('LOC:Rating'))

3.
----
Description value for auto-complete needs to be a single field, not an expression.

4.
----
tick on "Use description instead of value".
(but I think this isn't really what you want here - you want the Web:Site I think.)

>> Maybe I'm doing something wrong?

there's always that chance, yes.

cheers
Bruce

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: AutoComplete Not Working
« Reply #4 on: March 04, 2014, 03:25:26 PM »
Hi Bruce,

>> a) WebSites table needs a (unique) key on the SITE field.

Q1) What option is the key using? Order By, Filter, Value or Description.
Q2) Can the key have other fields defined? I.E. Key on WEB:Site, WEB:SysID
Q3) Does the key need to have the SITE field as the first field in the key?

I added the unique key with WEB:Site as the only field in the key and the autocomplete is now working. BUT in my production app I have a table that cannot have the 'Value/Description' field as a unique key by itself. There is a unique key in the dictionary for this field but the autocomplete does not work.

The 'Table': Cause
The 'Order By': CAU:Cause
The 'Value/Description': CAU:Cause
The 'Filter': CAU:CategoryID = '& p_web.GSV('INC:CategoryID')
The unique 'Key': CAU:CategoryID, CAU:Cause

>> change your trace statement from...

I changed the trace as you said and now the debug shows a different value for 'Rating' every time, even if I am choosing the same Site.

Regards,
Trent

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: AutoComplete Not Working
« Reply #5 on: March 10, 2014, 02:33:25 AM »
Hi Trent,

>> Q1) What option is the key using? Order By, Filter, Value or Description.

none of the above. It's used by the GetDescription method.

>> Q2) Can the key have other fields defined? I.E. Key on WEB:Site, WEB:SysID

nope.

>> Q3) Does the key need to have the SITE field as the first field in the key?

yes. First and only.

cheers
Bruce

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: AutoComplete Not Working
« Reply #6 on: March 10, 2014, 08:11:38 PM »
Hi Bruce,

I'm not sure I get this: >> none of the above. It's used by the GetDescription method.

What does the GetDescription method use to figure out the key?

Also the 'More Assignments' are not working for me. The variables are not being set. Can you please give me an example of how the 'More Assignments' work?

Regards,
Trent

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: AutoComplete Not Working
« Reply #7 on: March 10, 2014, 09:15:28 PM »
Hi Trent,

The GetDescription method is in netweb.clw, and called from netweb.tpw if you're interested.
But frankly, there's no point in going down that road. How it uses the key is not terribly interesting. All you need to know is that for the auto-complete to work you need a single-component (preferably unique) key on the description field.

>> Q1) What option is the key using? Order By, Filter, Value or Description.

The key needs to be on the Description field.

>> Also the 'More Assignments' are not working for me. The variables are not being set. Can you please give me an example of how the 'More Assignments' work?

Post a small example and I'll take a look. Tweaking any of the existing examples should suffice to show the problem, and from that a quick fix should be do-able. With the NetTalk 8 release this Friday, I'm a bit short of time at the moment, so an example will help.

Cheers
Bruce

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: AutoComplete Not Working
« Reply #8 on: March 10, 2014, 10:33:22 PM »
Hi Bruce,

Thanks for the explanation - it makes sense now.

I've made an example of the more assignments but of course it seems to work in the example. I'll keep working on it.

Regards,
Trent

trent

  • Full Member
  • ***
  • Posts: 204
    • View Profile
    • Email
Re: AutoComplete Not Working
« Reply #9 on: March 12, 2014, 02:29:24 PM »
Got the 'more assignments' working!

1) Had debug in the wrong place, the assignment happens later than the 'server code' embed for the field.
2) Some issues with the in memory table I was using for the auto complete.

Regards,
Trent