NetTalk Central

Author Topic: How to SendMessage in a button  (Read 3733 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
How to SendMessage in a button
« on: May 15, 2020, 06:53:40 AM »
Hi, Im checking the stock of an article when the user press a vutton in a NetWebBowse row

Code: [Select]
if ControlarStock(p_web.gsv('Aci:IZARTICULO'))=0
    p_web.ssv('Cantidad',0)
    p_web.AddLog('3-sin stock cantidad= '&p_web.gsv('Cantidad'))
    loc:invalid   = 'stock'
    loc:alert     = 'Actualmente sin Stock, intente mas tarde.'
    DO SendMessage

And I got no message.
How to do it?
Thanks
-----------
Regards
Alberto

Matthew51

  • Full Member
  • ***
  • Posts: 152
    • View Profile
    • Email
Re: How to SendMessage in a button
« Reply #1 on: May 15, 2020, 01:43:16 PM »
I find browses don't use loc:alert, even though they declare it. Instead I put the browse in a form (if it isn't already, most of mine are) and save the alert test to a session value. Then in the Server Code for the form element add

Code: [Select]
loc:alert = p_web.gsv('AlertText')
p_web.DeleteSessionValue('AlertText')
Contractor with 10+ years of NetTalk experience looking for work.
www.linkedin.com/in/matthew-leavitt
BisWare.ca
Check out my free EasyTime Template

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: How to SendMessage in a button
« Reply #2 on: May 15, 2020, 02:27:19 PM »
My browse is inside a Mem Form, and if I use the same code in an EIP field of the same browse it works, it do not work in a button in the same row.
-----------
Regards
Alberto

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: How to SendMessage in a button
« Reply #3 on: May 16, 2020, 02:43:23 AM »
Hi Alberto,

Maybe I'm wrong but isn't it possible to do a javascript alert?

Rene
Rene Simons
NT14.14