NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Alberto on February 26, 2020, 02:10:35 PM

Title: Open a NetWebForm in popup mode with a param
Post by: Alberto on February 26, 2020, 02:10:35 PM
Hi, I have a NetWebForm that has many buttons which must open the SAME Form for insert different types of registry.
Please see pic.
I know the popupp is opened by the browser and so on but...
Is there any way to do this?
Title: Re: Open a NetWebForm in popup mode with a param
Post by: Bruce on February 26, 2020, 07:52:46 PM
I'm not sure I understand the question.
Are you saying that the multiple buttons do not work?
Title: Re: Open a NetWebForm in popup mode with a param
Post by: Alberto on February 27, 2020, 04:17:22 AM
No, this buttons opens the same popup form, but this form must show some differents fields and insert a different type fo record depending on the calling button.
With button nr1 the form must insert setting rec:type=1, with button nro2 some fields must be hidden and rec:type=2 and so on.
I need a way of knowing which button has called the popup form.
Title: Re: Open a NetWebForm in popup mode with a param
Post by: osquiabro on February 27, 2020, 06:24:24 AM
maybe loc:act =1(insert) or loc:act = 2(Change)
Title: Re: Open a NetWebForm in popup mode with a param
Post by: Bruce on March 01, 2020, 10:02:12 PM
If you look in your web log, at the incoming button press, you'll see the text of the button that was pressed is passed to the form. So you could use this in the form to decide what to prime fields to.

cheers
Bruce
Title: Re: Open a NetWebForm in popup mode with a param
Post by: Alberto on March 02, 2020, 05:30:29 AM
Clicking in Traslado Button which has TIPO=40 in the parameters I get:

GET /udetalletraslado?_ajax_=1&pressedButton=insert_btn&_popup_=1&_bidv_=&TIPO=40 HTTP/1.1

I dont see any button name in any log line.

How can I read the TIPO=40 in the popup form?
Title: Re: Open a NetWebForm in popup mode with a param
Post by: Matthew51 on March 02, 2020, 01:39:44 PM
p_web.getValue('TIPO') should do the trick.
Title: Re: Open a NetWebForm in popup mode with a param
Post by: Bruce on March 02, 2020, 10:11:48 PM
>> p_web.getValue('TIPO') should do the trick.

If you are on the event that was triggered with this parameter, then yes, this would work.
More generally I would suggest;

p_web.StoreValue('TIPO') at the top of the form procedure, and then in your code simply use
p_web.GetSessionValue('TIPO')

cheers
Bruce