passing list data between forms

passing list data between forms

Post by Ethan Shayn » Tue, 02 Apr 2002 12:36:59



I have form A which consists of a list. The user can select an item
from the list and click on a button. The idea is that this will bring
up form B, prefilled with some data about the item that the user had
selected on form A.

My question is, what is the best way of determining which item the
user selected when initializing form B? The two options I think are:

1. After capturing the button-click event on form A, stick the user
selection in a global variable. Then open form B, and during form B's
initialization look at the global variable.

2. I'm not sure if this is possible, but - during form B's
initialization, access the list directly on form A. I suspect this
would require keeping a handle to form A in a global variable.

Or is there some other, better approach?

        Thanks,
                Ethan Shayne

 
 
 

passing list data between forms

Post by Ben Combe » Tue, 02 Apr 2002 13:11:16




Quote:> I have form A which consists of a list. The user can select an item
> from the list and click on a button. The idea is that this will bring
> up form B, prefilled with some data about the item that the user had
> selected on form A.

Cool.. first thing is to make form B into a dialog.

Quote:> 1. After capturing the button-click event on form A, stick the user
> selection in a global variable. Then open form B, and during form B's
> initialization look at the global variable.

How about have the button press handler in A do this series of steps:

frm = FrmInitForm(FormB)
FrmDrawForm(frm)
// alter controls in form B to be based on values you've saved from A
FrmDoDialog(frm)
// if this returns your OK button ID, read controls on form B and put
back into A's controls
FrmDeleteForm(frm)

--

CodeWarrior for Palm OS technical lead

 
 
 

passing list data between forms

Post by Ethan Shayn » Wed, 03 Apr 2002 08:42:38






>> I have form A which consists of a list. The user can select an item
>> from the list and click on a button. The idea is that this will bring
>> up form B, prefilled with some data about the item that the user had
>> selected on form A.

>Cool.. first thing is to make form B into a dialog.

Not that I have any particular objection to this, but any particular
reason?

Quote:

>> 1. After capturing the button-click event on form A, stick the user
>> selection in a global variable. Then open form B, and during form B's
>> initialization look at the global variable.

>How about have the button press handler in A do this series of steps:

>frm = FrmInitForm(FormB)
>FrmDrawForm(frm)
>// alter controls in form B to be based on values you've saved from A
>FrmDoDialog(frm)
>// if this returns your OK button ID, read controls on form B and put
>back into A's controls
>FrmDeleteForm(frm)

This may be kind of a dumb question, but wouldn't I want to alter the
controls in form B *before* calling FrmDrawForm(frm)?

        Thanks,
                Ethan Shayne

 
 
 

passing list data between forms

Post by Ben Combe » Wed, 03 Apr 2002 14:45:37






> >> 1. After capturing the button-click event on form A, stick the user
> >> selection in a global variable. Then open form B, and during form B's
> >> initialization look at the global variable.

> >How about have the button press handler in A do this series of steps:

> >frm = FrmInitForm(FormB)
> >FrmDrawForm(frm)
> >// alter controls in form B to be based on values you've saved from A
> >FrmDoDialog(frm)
> >// if this returns your OK button ID, read controls on form B and put
> >back into A's controls
> >FrmDeleteForm(frm)

> This may be kind of a dumb question, but wouldn't I want to alter the
> controls in form B *before* calling FrmDrawForm(frm)?

You can alter some controls before FrmDrawForm, but some things
shouldn't be done until after the form is drawn.  For example, you
shouldn't set focus on a field until after a draw has been done, and if
you change the value of a label, it might draw early and show up when
the form is erased.

--

CodeWarrior for Palm OS technical lead

 
 
 

1. Can I pass pdf form data via URL

Hi,
I need to generate pdf copies of online order forms. The dealer uses
on online order form to fill in fields, then presses a button to
generate the dealer copy & customer copy of the order form. The dealer
copy, customer copy and terms & conditions are in a multipage pdf
file. I want to draw some fields on this pdf file then pass the data
from the online form via URL to the pdf file. Is this possible? What
is the best way to do this? Note, I aready have the online order forms
working and connected to a database. I was thinking you could do
something like
https://xxx/.../order_form.pdf?name=xxx;address=xxx;phone=xxx;...

I know what I want to do but not how to get  the data into the pdf
file. Anyhelp would be appreciated.

Thanks
Mike

2. Dave Barry on American Political Leadership in 2000

3. fdf newbie - more questions (cached form data and how to get URL referer of PDF form)

4. what kind of internet access can I find through fiber?

5. Data input from a paper form scanned into computer readable data

6. 39 Bar Code TTF

7. Data Forms & Data Validation

8. PC133 RAM Whats the point?!

9. Tabbing from a Data Window to a Sub-Form Data Window???

10. pass a variable trough another sub via a form

11. passing variables to new forms

12. how to pass a 2D array to another form ?

13. Excel Data list -> Mailing list ?