NetTalk Central

Author Topic: Calling a memory form from another  (Read 4608 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Calling a memory form from another
« on: March 02, 2012, 03:28:15 PM »
Hi Guys,

I have a memory-based form, that I'd like to call from another memory-based (NetWebForm-Wizard).

I have some code in the "ValidateAll" embed of the NetWebForm-Wizard and need to call the second form from here - subsequent to the current code.

Is there a simple way to call the second form from here?

So, when the NetWebForm(Wizard) closes, it should call the second form (page).



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Calling a memory form from another
« Reply #1 on: March 02, 2012, 07:48:30 PM »
do your validation along the way. You talk about "redirect" but actually you are meaning a "repost". You can't "repost" the form - you need the submit of the form to go straight to the other site.

cheers
Bruce

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Re: Calling a memory form from another
« Reply #2 on: March 03, 2012, 01:52:48 AM »
Hi Bruce,

I am not trying to repost the NetWebForm(Wizard), I have some code in the ValidateAll embed of this form, and the last line of the code is a "redirect" to another site, where I am using:
p_web.redirect('http://destination.co.za')

This is working well :-)
The form closes and the user is redirected to the destination site.

HOWEVER, I am trying to redirect to another page (form) within my application instead of an external URL.

When I replace p_web.redirect('http://destination.co.za') with my internal procedure name p_web.redirect('procedure_name'), it doesn't work.


So I only need the know how to "redirect" do another page/form in my web-app from the ValidateAll embed of the current form?

Rob de Jager

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: Calling a memory form from another
« Reply #3 on: March 03, 2012, 06:02:31 AM »
I would set the url in the URL on Save or URL on Cancel fields in the template. That said, those fields are not variables that can be changed while the form has already been opened i.e. the "url" may be determined at procedure setup or at generate form embed.

Cheers

Rob

rupertvz

  • Sr. Member
  • ****
  • Posts: 326
    • View Profile
    • Email
Re: Calling a memory form from another
« Reply #4 on: March 04, 2012, 03:24:08 AM »
Thanks Rob,

However, this is exactly the problem I experience,
When I put a URL in the "URL on Save" the form discards the code in ValidateAll.

Hence, I am unable to use code in ValidateAll and the "URL on Save" 
The code in ValidateAll of the form, is vital!

Is there any way that I can put the "redirection URL" after my code in ValidateAll?

How do I call another page (form procedure) from here?

Rob de Jager

  • Jr. Member
  • **
  • Posts: 54
    • View Profile
Re: Calling a memory form from another
« Reply #5 on: March 04, 2012, 06:05:03 AM »
Ah, your update form is a popup  ;) My suggestion will work with a non-popup form. Off the top of my head, I don't think you will be able to redirect while the form  is popped up so to speak.....that is a "modal" state. You would have to close the form first and then decide where you want to redirect to from the browse you are viewing....or don't make the form a popup.

In terms of why the redirect works for say www.google.co.za and not a procedure in your app; if I remember correctly, redirect requires url and not just a procedure name.

Cheers

Rob

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Calling a memory form from another
« Reply #6 on: March 04, 2012, 07:19:04 AM »
>> When I put a URL in the "URL on Save" the form discards the code in ValidateAll.

only if the url is for a different domain (ie a different site). If it is another procedure in the same app it'll be ok.

cheers
Bruce