NetTalk Central

Author Topic: I have a PopUp Form with an AutoStart Button can I autoClose after done ?  (Read 2852 times)

MikeR

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Email
I have a netwebform
with a start button
set to auto start
the url is set to autoopen the link to a '_blank' another window when complete
I want to autoclose the popup window if all went well

Alberto

  • Hero Member
  • *****
  • Posts: 1874
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: I have a PopUp Form with an AutoStart Button can I autoClose after done ?
« Reply #1 on: November 16, 2024, 08:11:44 AM »
Hi, try
p_web.Script( p_web.WindowOpen( 'YourProcedure'))
-----------
Regards
Alberto

MikeR

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Email
Re: I have a PopUp Form with an AutoStart Button can I autoClose after done ?
« Reply #2 on: November 21, 2024, 09:16:33 PM »
Hi Alberto not sure what you mean here and where I should put the code ? Will this Close the window "YourProcedure" ?

rjolda

  • Sr. Member
  • ****
  • Posts: 333
    • View Profile
    • Email
Re: I have a PopUp Form with an AutoStart Button can I autoClose after done ?
« Reply #3 on: November 22, 2024, 02:21:23 AM »
HI Mike,
I use the code p_web.Script( p_web.WindowOpen( 'YourProcedure')) in several ways.

1. I have a button which selects a line from a browse to use as a reference during the session.
  when the user presses this button and my code is done the last line of my code can be - p_web.Script( p_web.WindowOpen( 'IndexPage')) and it will go there.  However, I prefer the second approach.

2. The same browse is called from two different procedures which are menus.  To return to the menu which called this browse I pass a paramenter - 'IR=YES'  or 'IR=YES_SM' .
in the browse,  % BeforeFormTag/5000 embed:
   if P_web.gsv('loc:IR') = 'YES' or P_web.gsv('loc:IR') = 'YES_SM'
        p_web.SSV('SubHeading', 'Please Select Auto Dealership for this Service!')
      !  loc:selecting = true
  end
       
         
      IF  P_web.gsv('loc:IR') = 'YES_SM'
            loc:CloseAction = 'A_MOBILEBUTTON_MEMFORM'   ! call small menu
        else
            loc:CloseAction = 'INDEXPAGE'  ! go back to index page for large menu
      END
    This is where the action is set to perform when the Close Button is pressed.  So, when the user picks a record. I pop up a message that identifies the chosen record and then prompts them to press the CLOSE button.  I prefer code 2 so that I make sure that each procedure I open is closed correctly.

[Behind the scenes.  How did I get there... I put the procedure name to run in the Template when the close button is pressed.  I then looked at the code and the Close button uses loc:CloseAction as a reference to the procedure to run when CLOSE is pressed.  I then looked at where the template assigned the value to the loc:CloseAction.  It is way up in the code before calling the form tag.  So, right after the Template assigned it, I popped in my code to overwrite that assignment to the one I wanted to be run - hence, the code above....]
Ron     

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11254
    • View Profile
Re: I have a PopUp Form with an AutoStart Button can I autoClose after done ?
« Reply #4 on: November 26, 2024, 08:59:32 PM »
p_web.ntform(loc:formName,'clickClose')