This topic is locked
[SOLVED]

 Close Runner.displayPopup Window

6/11/2020 10:01:13 AM
PHPRunner General questions
C
chandoshi authorDevClub member

Can someone who have implemented the Runner.displayPopup code help me please.
I have implemented the code exactly as in the PHPManual example (That is what I think),

but I cannot programmatically close the popup on clicking on save button.
I am opening a popup with following code
window.popup = Runner.displayPopup({

url: Runner.pages.getUrl("request","add"),

width: 700,

height: 500,

header: result.txt

});
and have added the following in After Record added event
$pageObject->setProxyValue('saved', true);

$pageObject->stopPRG = true;
and using the following code in Javascript onload event of the Add page
if ((proxy['saved']) && window.parent && window.parent.popup) {

window.parent.popup.close();

}
The popup window does not close. What am I doing wrong?
Sergey was able to help. I had to change my selection in "Page - Add record" setting from "Return to List page" to "Add Next record - Stay on Add page"

Sergey Kornilov admin 6/11/2020

You cannot say you implemented the code "exactly" if you made some changes and potentially introduced some errors.
For instance in the manual you can see that header value is specified in quotes:

header: 'Add new product'


while in your code example quotes are missing:

header: result.txt


Please refer to the manual for correct syntax:

https://xlinesoft.com/phprunner/docs/how_to_display_any_page_in_a_popup.htm
In either case, if something that is Javascript-based doesn't work as expected here is your first stop:

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