Normal Topic How to pass variables to @FormAsDialog()? (Read 726 times)
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
How to pass variables to @FormAsDialog()?
Feb 26th, 2011 at 11:41pm
Print Post Print Post  
Is there a way to pass variable data to a form called with @FormAsDialog()?

I'm looking to make a somewhat fancier version of the Follow-Up Scheduler that will be generic--instead of having to code a popup for each date field, just pass a date to the form and then extract the user-selected date from the return string.  So far the form only uses variables, no fields.  (One of the dialog features is three radio buttons for when the result falls on a weekend--move the date ahead to Monday, back to Friday, or leave it.)  I expect I'll use @Calendar() in some way but haven't decided on the specifics yet.

From what I can tell, I can't just define and set a variable in the calling form (Status) because when the popup form loads it fails to compile because it sees an undefined variable.

I have looked at trying to use FormFieldValue and FormThrowFocus--open the form, set the date on that form, then throw focus to that form. But the Programming Guide says the entire routine will run before it throws focus to the Scheduler form.

It looks like I could create an invisible "Way_Station" form with one (or more) unbound field(s), pass the value(s) to that, then open the Scheduler dialog and have it pull the value(s) from that form.  Once the Scheduler closes, also close the invisible form.  But that is kind of kludgy (if it will work at all). (The reason for the Way Station form is to keep things generic--the Scheduler and other Form-as-Dialog forms don't have to be hard-coded to pull from main forms.)  (An alternative would be a Way Station database with one record.)
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: How to pass variables to @FormAsDialog()?
Reply #1 - Feb 27th, 2011 at 12:05am
Print Post Print Post  
Check out ClientLocalValue and @ClientLocalValue.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Rick_R
Full Member
***
Offline



Posts: 243
Joined: Jan 29th, 2010
Re: How to pass variables to @FormAsDialog()?
Reply #2 - Feb 27th, 2011 at 1:03am
Print Post Print Post  
Aw, heck!  And I just set up a Way_Station form (didn't code everything related to that approach, though.)

Thanks!
  
Back to top
 
IP Logged