Refresh on Lightbox Close

Hi there! I am working on a web app currently where we use a lot of lightboxes to adjust settings and do micro user interactions. I keep running into an issue where the lightbox will close, but the information on the page is not updated based on the interaction. Could we get a feature where we can refresh a page on lightbox close?
Simply doing a wixLocation.to(“url”); does not work - especially with dynamic pages.

Loving WixCode! Hope to see more features soon so we can keep creating with it!

2 Likes

I could use an answer to this, too. Have you received any responses?

Hey
This is already possible. When you open the Lightbox that creates a promise so when you handle the opening of any Lightbox as a promise you can do whatever you want when the Lightbox closes. Look in the Wix Code API reference on Lightboxes and how to use it with a promise. Then you could just add the wixLocation.to(“any url here”); Works great!

The URL for a dynamic page isn’t working when hitting the close button on a lightbox. Am I missing a step?

Paste in your current code here, paste it, select it and choose to format it as code using the {}

Hello, this is what I have on the lightbox where button7 is my close button. The lightbox opens from the dynamic page and when closing, it does not refresh the page. Thanks for looking.

 
export function button7_onclick(event) {
  wixLocation.to(`/Tenants/Update/${wixUsers.currentUser.id}`); 
}