NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on May 15, 2020, 06:53:40 AM

Title: How to SendMessage in a button
Post by: Alberto 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
Title: Re: How to SendMessage in a button
Post by: Matthew51 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')
Title: Re: How to SendMessage in a button
Post by: Alberto 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.
Title: Re: How to SendMessage in a button
Post by: Rene Simons 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