I have a situation where it's ok for all three pages to have the same basic layout, so it's appropriate to do this with ad_form. I've got it working except for one small detail. If my key value is set, meaning we're either viewing or editing an existing record, ad_form_new_p always returns true, meaning that I have no way (that I know of, anyway) to distinguish between the view and edit cases.
The documentation for ad_form_new_p say "It returns 1 if the current form being built for the entry of new data, 0 if for the editing of existing data.". This doesn't make a whole lot of sense to me. If you're entering new data, most of the time you won't have a pre-allocated value for the key field so you won't be able to call ad_form_new_p at all.
I found a thread where Joel gives an example of a view/edit use of ad_form and he seems to be able to use ad_form_new_p to distinguish between the two cases, so I don't know where I'm going wrong here.
This matters for several reasons - I want to be able to set the page title correctly, and more importantly I think the return value of ad_form_new_p determines whether the new_data or edit_data block is executed.
Any suggestions on the right way to do this? An example from the toolkit would be wonderful; I've looked around but it seems that every use of ad_form looks a bit different, and I don't see any so far that are trying to do quite the same thing I'm trying to do.
Thanks in advance!