NetTalk Central

Author Topic: Calling form from code  (Read 4896 times)

oggy

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • Email
Calling form from code
« on: June 15, 2020, 04:35:09 AM »
On some condition, when user press the button, and if some value is true, how to call another form, in popup?
Something like this:
Case p_web.GSV('DoIt')
    OF 1 ! call process form
        StartProcess(p_web,Net:Web:Popup)
    OF 2 ! do nothing
END
the value 'Doit' is ok, but Startprocess procedure never fire it up.
Nettalk 11

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Calling form from code
« Reply #1 on: June 15, 2020, 06:32:49 AM »
this working for me:

CASE p_web.GetSessionLevel()
    OF  1       
       p_web.Script( p_web.WindowOpen( 'IndexPage'))
    OF  2     
        p_web.Script( p_web.WindowOpen( 'PageForActiveTransactions' ))
    OF  3     
        p_web.Script( p_web.WindowOpen( 'PageForSalesCustomer' ))
 END

oggy

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • Email
Re: Calling form from code
« Reply #2 on: June 15, 2020, 07:31:30 AM »
Yes, indeed, but I want popup form....

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Calling form from code
« Reply #3 on: June 15, 2020, 09:16:04 AM »
i have a code for a field that send a popup message to a user before change a value, the MessageBox is a pop up, take a look on ntd.push

p_web.Script('ntd.push(''MessageBox'','''&p_web.nocolon('Bil3:ShipToZipCode')&''','''&p_web.jsParm(p_web.translate('Confirm'))&''',1,'&Net:LookupRecord&','''',''UpdateBillofLading'','''','''')' )   

oggy

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • Email
Re: Calling form from code
« Reply #4 on: June 15, 2020, 09:17:44 AM »
Aha, seems that this is what I want. Is the second parameter mandatory or omitted?

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Calling form from code
« Reply #5 on: June 15, 2020, 11:03:39 AM »
look at jquery.nt-dialog.js

oggy

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • Email
Re: Calling form from code
« Reply #6 on: June 16, 2020, 01:32:49 AM »
Ok, got it, but its not working every time.
For example, if I choose to open second form and close first one, sometimes the process works well, but sometimes not.
In attachment, screenshots.
When pressing confirmation button on first form, I use jquery to close that form after some process. Ok, the form is closed, but second form is sometimes not formed well.
Code for closing:
p_web.script('$(''#popup_'&lower('UpitProcesa')&'_div'').dialog(''close'');')

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: Calling form from code
« Reply #7 on: June 16, 2020, 04:54:40 AM »
as Bruce says, a demo.. ;D ;D ;D