This topic is locked
[SOLVED]

 Close bootstrap popup after pressing save button - Add page not related to initiating form

4/15/2019 8:14:13 AM
PHPRunner General questions
C
ChrisOmn author

Please can someone give advice on how to close a bootstrap popup after pressing save button when an Add page is not related to the initiating form.
I tried these links (I couldn't find better than this) but the result on save is the _add.php popup is replaced by the related _list.php form and not simply close the popup.
https://xlinesoft.com/blog/2016/07/07/displaying-a-popup-in-phprunner-9-0-asprunnerpro-9-5-asprunner-net-9-0/

https://asprunner.com/forums/topic/24201-close-bootstrap-popup-after-pressing-save-button/

In my 'Pages' settings, I have _add.php set as 'After record is added: Return to list page' - is this causing an issue?
My example:
customer_list.php page.

Click 'tick box' next to a customer record.

Click custom button to load popup with 'orders_add.php' form to create new order for selected customer.
customer_list.php custom button ClientBefore code

window.popup = Runner.displayPopup( {

url: "orders_add.php" });
orders_add.php AfterAdd event

$pageObject->setProxyValue('saved', true);

echo "";
orders_add.php Javascript OnLoad event

if ( (proxy['saved'] ) && window.parent && window.parent.popup ) {

window.parent.close();

window.parent.location.reload();

}

C
ChrisOmn author 4/15/2019

I've added debug messages and notice if 'Pages' setting 'After record is added:' set to 'Return to list page' or 'Open the new record Edit page', 'After record added' event does not fire.
If I set 'Pages' setting 'After record is added:' set to 'Add next record - stay on Add page', 'After record added' event does fire.

C
ChrisOmn author 4/15/2019

Javascript syntax error at fault - no issue.