This topic is locked

How to modify redirect link in custom edit page in page designer

9/12/2018 7:48:30 PM
PHPRunner General questions
E
exora author

In page designer, I have 4 pages:

  1. list
  2. edit
  3. list1(copy from list with layout modified)
  4. edit1(copy from edit with layout modified)
    In the list1I modify page link in grid edit properties so that when edit button clicked, it will go to edit1 and it works fine. But when I click "Save" or "Back to List" button in edit1, it will go to list, not list1.
    So, I have tried to make custom button for "Save" and "Back to List" in edit1 and it works, but everytime I click the "Save" button it always show warning message: "Are you sure you want to leave this page?"
    My questions:
  5. How to modify redirect link in "Save" button and "Back to List" button in edit1so that it can go to list1.
  6. How to disable the warning message "Are you sure you want to leave this page?"

admin 9/13/2018

You can turn off "Are you sure you want to leave this page?" option on Miscellaneous screen:

https://xlinesoft.com/phprunner/docs/miscellaneous_settings.htm
In regards to redirect - use events like AfterAdd and AfterEdit to redirect user to correct page.

E
exora author 9/13/2018

Thank you Sergey.



You can turn off "Are you sure you want to leave this page?" option on Miscellaneous screen:

https://xlinesoft.com/phprunner/docs/miscellaneous_settings.htm


Solved.



In regards to redirect - use events like AfterAdd and AfterEdit to redirect user to correct page.


I have tried this tips, but it affect not only for edit1page but also edit. While what I want is after saving in edit1back to list1page and after saving in editpage will return to the listpage.

admin 9/13/2018

Here is how you can do this in event like AfterEdit:

if ($pageObject->pageName=="edit")

header("Location: tablename_list.php");

else ($pageObject->pageName=="edit1")

header("Location: tablename_list.php?page=list1");