cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Closing a parent window when the modal child is closed

Regular Member

Closing a parent window when the modal child is closed

I have a mashup with a button that uses a hidden navigation widget to open a modal child window that is just a confirmation message.  When the child window is closed I would like for the parent to also close so the user does not click the button again.  Looking for the cleanest way to handle this.  Any help would be appreciated

7 REPLIES 7

Re: Closing a parent window when the modal child is closed

Expression widget that is triggered upon popup closed event

I think you can use window.close()

 

Re: Closing a parent window when the modal child is closed

Thanks for the response!  I bound the Expression 'Evaluate' event service to the Navigation widget's PopupClosed event with an Expression of "close()" however that did not close the parent.  "window" appears to be a reserved word that gives an error so window.close() doesn't seem to be usable.  Any thoughts? 

Re: Closing a parent window when the modal child is closed

You could try just close()

else you may have to create a custom extension to bring in that script.

Re: Closing a parent window when the modal child is closed

Stumbled upon this, thankfully.  I had been trying to figure out how to initiate the print dialog (ctrl+p) from an expression widget. 

I just tested close() and print() in an expression widget triggered by a button and they seem to work.

Re: Closing a parent window when the modal child is closed

Hi PaiChung,

 

close(); function working when the current tab is triggered from a parent.

 

If I copy the URL and put into a new window, not working.

 

Do you have the solution for the same?

 

Regards,

 

Janakiraman P

Re: Closing a parent window when the modal child is closed

Can you explain this a little better please?

What exactly does it mean to 'copy the url into a new window'?

Re: Closing a parent window when the modal child is closed

Please follow the below URL,

 

https://community.ptc.com/t5/ThingWorx-Developers/How-to-close-the-mashup-on-button-click/m-p/587900...

 

 

 

 

Regards,

 

Janakiraman P