Service Portal - Forcing widget re-render from server script - embedded widget not clearing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2023 06:42 AM
I have a tricky one. When I browse to a knowledge article from the portal search bar, it does not do a full re-render of the site (unlike everywhere else), the url updates and the knowledge article is displayed, but it's not a full reload.
I have a footer widget that displays certain info depending on the page the user is on, however due to this (what appears to be SPA architecture), the footer does not know to re-render. As far as I can tell, only the sever script in the footer widget is rerun when the knowledge article loads.
Does anyone know how to tell the footer widget it needs to re-render in this scenario?
I thought I was binding it using ng-if. Here’s the offending line, it’s an embedded widget within my footer (displays a button basically on the footer depending on which page you’re on):
<sp-widget ng-if="data.myTickets" widget="data.myTickets"></sp-widget>
Server:
if (on certain page) {
data.myTickets = $sp.getWidget('footer_cta', myTicketsOptions);
}
Navigating back and forth I then get multiple versions of the embedded widget showing up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 03:07 AM
I've run into this issue again and can't remember how I resolved it last time. Anyone got any ideas?