This topic is locked

Master detail

12/11/2007 3:26:52 AM
PHPRunner General questions
J
Jepsen author

I have a Master and a Detail table
The detail table is users comments to the master table. It is unlikely that the user will send more than one comment on a subject, and the user have no benefit from seing other users comments.
I want the user to open detail_add directly from the master table, bypassing the details_list, which is just an unnessary step confusing the user.
I have searched the forum at I would have thought that someone else would have tried the same, but I cannot find anything which appears relevant.
Any suggestions pls ?

J
Jane 12/11/2007

Morten,
you can do it using List page: Before process event for detail table on the Events tab.

Here is a sample:

//** Redirect to add page ****

header("Location: DetailTableName_add.php");

exit();

J
Jepsen author 12/11/2007

Jane
You are genious. This is so simple and elegant. I buy this one.
However, where will this bring me once i "go back to list"?
I really want to return to the master list in the view I had, once I have saved my detail.
I cannot trys this out till I get home (firewall at work prevents this) but I am sure your re-direct will work.
Best regards

Morten

J
Jane 12/11/2007

Morten,
try to do the following:

  1. edit detail link on the master list page on the Visual Editor tab.

    Here is a sample:


    <A class=tablelinks2 href="DetailTableName_list.php?action=add&{$row.1DetailTableName_masterkeys}"

    {if $useAJAX} onmouseover="RollDetailsLink.showPopup(this,'DetailTableName_detailspreview.php'+this.href.substr(this.href.indexOf('?')));" onmouseout="RollDetailsLink.hidePopup();" {/if}>DetailTableName</A>


2. change code in the List page: Before process event:



if ($_REQUEST["action"]=="add")

{

//** Redirect to add page ****

header("Location: DetailTableName_add.php");

exit();

}



[/quote]

J
Jepsen author 12/12/2007

Morten,

try to do the following:

  1. edit detail link on the master list page on the Visual Editor tab.

    Here is a sample:
  2. change code in the List page: Before process event:



[/quote]
Jane
I could not get the edit of the link to work. However, a redirect from details_list and another redirect from details_add solved the problem, and the application works quite nicely.
Thanks for the help.
Regards

Morten