NetTalk Central

Author Topic: Client side code not firing on calling lookup procedure NT545  (Read 3997 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Client side code not firing on calling lookup procedure NT545
« on: January 25, 2012, 04:59:54 AM »
Windows7Ultimate 64bit Clarion 63_9056 NT545
I have a field APP:ProductID
I have checked lookup button and set the lookup info 'from table' etc.
On the clientside server code
I have the following code
DO CalculatePremium
p_web.SSV('NewProductCode',p_web.GSV('APP:ProductID'))
p_web._trace('application_form newproductcodevalue ' & p_web.gsv('NewProductCode'))

The trace does not fire these are  the dbgview lines selecting the product lookup
[\\DAVCOMM-A9E687B]
00000005   55.67189789   [3552] [netTrace][thread=4] SendError = 404 The page cannot be found : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. FileRequest=[davcomm.css]
00000006   58.29903030   [3552] [netTrace][thread=4] SendError = 404 The page cannot be found : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. FileRequest=[davcomm.css]
00000007   61.06856918   [3552] [netTrace][thread=4] SendError = 404 The page cannot be found : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. FileRequest=[davcomm.css]
00000008   64.32103729   [3552] [netTrace][thread=4] SendError = 404 The page cannot be found : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. FileRequest=[davcomm.css]
00000009   66.82864380   [3552] [netTrace][thread=4] SendError = 404 The page cannot be found : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. FileRequest=[davcomm.css]
00000010   68.98772430   [3552] [netTrace][thread=4] SendError = 404 The page cannot be found : The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. FileRequest=[davcomm.css]
00000011   71.85068512   [3780] GROUP/OPTION: draw text

The DO calculate premium routinee (obviously) calculates a premium which field I reset in the clientside reset field
No premium is calculated although wherever else in the procedure I call the do calculate routine the premium is calculated, the newproductcode is also not set.

It appears that the client side code is not firing in this situation.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Client side code not firing on calling lookup procedure NT545
« Reply #1 on: January 25, 2012, 07:01:15 AM »
sorry - Terry, I'm really not understanding the question. Can you post an example?

cheers
Bruce

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Client side code not firing on calling lookup procedure NT545
« Reply #2 on: January 26, 2012, 04:04:38 AM »
Hi terry,

if your lookup is a popup then you might need to move your code to the embed GotFocusBack and call the reset of the field by handcode.

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Client side code not firing on calling lookup procedure NT545
« Reply #3 on: January 26, 2012, 07:29:29 AM »
Thanks Kevin
No lookup is standard, no popup.
I'm going to see if I can create a small uploadable demo this evening.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Client side code not firing on calling lookup procedure NT545
« Reply #4 on: January 26, 2012, 08:35:43 AM »
NT545
Attached is app web2a which uses the standard dct and tables from example2.
I have added a p_web._trace line in the alias_FORM ali:mailboxnumber in  clientside server code
start dbgview

select the test menu
insert an alias record including selecting a mailbox number

There is no debugview line.

[attachment deleted by admin]
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Client side code not firing on calling lookup procedure NT545
« Reply #5 on: January 27, 2012, 12:53:23 AM »
hi Terry,

ok, I'm with you now.

so - the Validate::fieldname routine is called asynchronously when the entry field on the form changes. this might happen if the user types in a valid value (in the example try Dave or Eliza). It's a good place to call some code you want to do to the screen when the field changes _but the page does not_.

that's the key. It's a good place when the page doesn't change. You _should_ have your code there to cater for the directly entry of a valid value, or indeed if you change to a popup lookup. (the appearance and disappearance of popups does not mean the _page_ changes)

but in the example, if you click on the lookup button then the page does change. And when you click select on the lookup the page changes again. So the Validate::fieldname routine is no good.

There is however another routine - one called "after lookup". In this routine you can embed additional actions to take "when a lookup has been completed".

Because we don't like duplicating embed code unnecessarily, the Validate::fieldname routine _also_ calls "After Lookup" regardless of how the field actually changed. So, in short, you can move your code from Validate::fieldname into AfterLookup - you don't need it in both places.

cheers
Bruce

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Client side code not firing on calling lookup procedure NT545
« Reply #6 on: January 27, 2012, 01:05:02 AM »
Thanks Bruce
That sorted it.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186