This topic is locked

returning to alternating list page after edit

6/7/2023 6:52:17 AM
PHPRunner General questions
T
telematics author

dear community,
I have two versions of the same list page (list and the additional list1). list is the default list page. when using list1 and entering from there to add/edit a record it works well, but after returning from the add/edit page the default list pages appears, not the list1 page where I started before.
my question is how I can "fix" the additional list1 page during this editing process. changing the default list page is not an option, I need the default page also.
I am using phprunner 10.6
regards
Helmut

Admin 6/7/2023

Can you use an event like AfterEdit and redirect user to the additional list page?

T
telematics author 6/8/2023

good point, but not sufficient!
it works when I "Save" anything in the Edit page. but it does not work when I use the button "Back to List" or "Cancel". for this kind of exit there are no standard events available (?)
any other way?
here my code. I am using a session variable to store, from which list-page I started to edit.
in the List page BeforeDisplay event:
// store from which list page the edit/add will be initiated if(isSet($_GET["page"])) { if($_GET["page"] == "list1") { $_SESSION["listpage"] = 1; } if($_GET["page"] == "list") { $_SESSION["listpage"] = 0; } } else { $_SESSION["listpage"] = 0; }in the Edit page AfterRecordUpdated event:
if ($_SESSION["listpage"] == 1 ) {
header("Location: table_list.php?a=return&page=list1"); //** Redirect to another page ****
exit();
}