NetTalk Central

Author Topic: Calling any of 3 form procedures  (Read 3623 times)

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Calling any of 3 form procedures
« on: August 31, 2011, 01:25:07 PM »
This sounds easy to - and probably is. But I just can't figure it out.

From a link I need to call any of three form procedures. I can't make the decision on the link itself because it is set up before the variables are known to make the decision with. So it has to be done on the procedure called by the link. I use another form procedure - without any controls on it - to make this decision using Xhtml portions and using the conditions to call the correct form procedure. BUT then this calling-form procedure generates a div for its own control buttons (called "*_saveset"), even without any buttons on it. This trows out alignment with other areas on the page and I can't get rid of it to make it look right. How can I disable the generation of the saveset div if there are no buttons on it?

Another alternative would have been not to use a form procedure as the calling-form but a websource procedure. In this case, what should be added to the packet to make it a proper form?

Thys

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Calling any of 3 form procedures
« Reply #1 on: August 31, 2011, 05:26:55 PM »
I have done this by making the target a session variable and then updating the field holding the target after a condition has been changed which also changes the session variable.

eg on a report screen I give users the option to either just run the report and wait for it to finish or spool the report which runs the report an a background thread so they are free to do other things while the report is generating. This process involves 2 different targets.

Not sure if the above is relevant to your situations...

Cheers,

Kevin

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Calling any of 3 form procedures
« Reply #2 on: August 31, 2011, 10:28:21 PM »
The simplest approach is to update the link when you have sufficient data to make a decision.
But more information on the link itself would be required to comment further in that direction.

The next simplest approach is to have a single form, but which has 3 different "behaviors" - ie merging all 3 forms into 1. This is possible in some cases, less easy to do in others.

Finally, you can't use a NetWebSource as the "decider". But you can use a NetWebPage. that though would have ancillary issues if you were attempting to go to a popup form.

cheers
Bruce

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: Calling any of 3 form procedures
« Reply #3 on: August 31, 2011, 10:43:52 PM »
To explain more, it's on the Login button of a login form. The form gets built before the decision can be made where to go. This decision can be finalised in the ValidateUpdate routine - but at that point the Login button is already set up. So the only way is to call another form that can make the decision in xhtml. I've done that but it's a NetWebForm that contains the empty saveset div that throw out the alignments with other areas on the screen.

If a page is used, how can I change it to act like a form and fit on to another page?

Thys

Thys

  • Sr. Member
  • ****
  • Posts: 311
    • View Profile
    • Incasu
    • Email
Re: Calling any of 3 form procedures
« Reply #4 on: August 31, 2011, 10:54:15 PM »
For the moment I solved my problem - amazing what a bit of soundboarding can achive...

The decision is made in 3 xhtml routines each with the conditions needed to generate the appropriate procedure's code. But I had them all to generate AFTER </FORM> which means that the saveset div is at its top. By moving all to BEFORE <FORM> forces the saveset div to be displayed below the generated code - which in my case solves the proble,

Thanks for you suggestions.
Thys