NetTalk Central

Author Topic: Open a NetWebForm in popup mode with a param  (Read 4588 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1871
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Open a NetWebForm in popup mode with a param
« 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?
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Open a NetWebForm in popup mode with a param
« Reply #1 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?

Alberto

  • Hero Member
  • *****
  • Posts: 1871
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Open a NetWebForm in popup mode with a param
« Reply #2 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.
-----------
Regards
Alberto

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Open a NetWebForm in popup mode with a param
« Reply #3 on: February 27, 2020, 06:24:24 AM »
maybe loc:act =1(insert) or loc:act = 2(Change)

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Open a NetWebForm in popup mode with a param
« Reply #4 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

Alberto

  • Hero Member
  • *****
  • Posts: 1871
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Open a NetWebForm in popup mode with a param
« Reply #5 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?
-----------
Regards
Alberto

Matthew51

  • Full Member
  • ***
  • Posts: 152
    • View Profile
    • Email
Re: Open a NetWebForm in popup mode with a param
« Reply #6 on: March 02, 2020, 01:39:44 PM »
p_web.getValue('TIPO') should do the trick.
Contractor with 10+ years of NetTalk experience looking for work.
www.linkedin.com/in/matthew-leavitt
BisWare.ca
Check out my free EasyTime Template

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: Open a NetWebForm in popup mode with a param
« Reply #7 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