NetTalk Central

Author Topic: Conditionally refer to another page.  (Read 3479 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Conditionally refer to another page.
« on: December 12, 2021, 12:30:03 PM »
Hi, all

I am a bit embarrassed to ask this because I am sure it is simple and documented even if I can't find it.

Users call a memory form from a menu;
the memory form is primed from intersession values;
if one of those values is set to TRUE the user should be referred to another page automatically;
if not the form is display to collect user input.

How do I do the automatic referral?

Thanks.   

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Conditionally refer to another page.
« Reply #1 on: December 12, 2021, 11:00:09 PM »
so, it's possible to trigger a redirect, (and I'll get to that) but first I want you to step back and consider your flow here.
Redirects are "slower" than just going to the right place, because instead of 1 request, 1 response, you end up with 2 requests and 2 responses.

So rather than a Redirect, I'd suggest looking at 2 things;
a) could the menu item be better constructed to go to the right place directly. Perhaps using 2 menu items with the same text, but with opposite include conditions? then the menu is ready to take the user to the right place.

b) could the destination form be better done to include both pathways - again with perhaps multiple tabs with conditions. Or a wizard form that can skip straight to tab 2 etc.

Assuming you can't make a better flow, you can do a redirect using

p_web.Redirect('someurl')
in the form - perhaps in the GenerateForm routine.

Cheers
Bruce

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: Conditionally refer to another page.
« Reply #2 on: December 13, 2021, 05:43:38 PM »
Thanks, Bruce

The menu item is a good idea that I hadn't considered.