Skip to main content
1-Visitor
February 12, 2020
Solved

How to refresh parent page containing collection widget cells after closing a popup window?

  • February 12, 2020
  • 2 replies
  • 2078 views

Hi,

I have a main mashup that contains a collection widget with some cells. Each of this cell has a button that navigates me to a popup window if clicked (using navigation function). In this case, if the user click an 'Add' button in the popup window, this will add something in the corresponding cell of the collection widget. My problem is once I click the "Add" button the cell is not updating in the main mashup unless i click on reload button on top. So I was thinking is there any way that I can refresh the main mashup on the event of the popup window close?

Best answer by Constantine

Hello @zaki4594,

  1. Add a session parameter, e.g. "refreshCalendar";
  2. When you close the popup, use an expression to put some value there, e.g. Math.random();
  3. On the parent mashup use refreshCalendar as an input to the "empty" validator (e.g. which always returns true). Make sure you specified "Auto evaluate", this will make it fire every time the session value changes;
  4. Finally, bind True event from the validator to whatever service you use to refresh your calendar;

I admit that it's not the most elegant approach, but it's the only one I found working reliably while solving a similar issue (was building a kanban page). By the way, at the end of the day we decided to go with a custom widget, partially because of the lack of drag-and-drop functionality, but chiefly because of performance issues (turned out that collections can be shockingly inefficient to render).

 

Regards,
Constantine

2 replies

17-Peridot
February 12, 2020

Hi,

 

I don't know if this helps you, but please check this article: https://www.ptc.com/en/support/article?n=CS249317

 

Best regards,

Raluca Edu

18-Opal
February 12, 2020

Hello @zaki4594,

  1. Add a session parameter, e.g. "refreshCalendar";
  2. When you close the popup, use an expression to put some value there, e.g. Math.random();
  3. On the parent mashup use refreshCalendar as an input to the "empty" validator (e.g. which always returns true). Make sure you specified "Auto evaluate", this will make it fire every time the session value changes;
  4. Finally, bind True event from the validator to whatever service you use to refresh your calendar;

I admit that it's not the most elegant approach, but it's the only one I found working reliably while solving a similar issue (was building a kanban page). By the way, at the end of the day we decided to go with a custom widget, partially because of the lack of drag-and-drop functionality, but chiefly because of performance issues (turned out that collections can be shockingly inefficient to render).

 

Regards,
Constantine