# Refresh TOC in sidebar panel on WYSIWYG save?

**URL:** <https://forum.xwiki.org/t/refresh-toc-in-sidebar-panel-on-wysiwyg-save/12841>\
**Category:** Help / Discuss\
**Tags:** macro, xwiki, panel, toc\
**Created:** [July 18, 2023, 10:48am UTC](https://forum.xwiki.org/t/refresh-toc-in-sidebar-panel-on-wysiwyg-save/12841 "2023-07-18T10:48:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![metawiki](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/m/b5e925/32.png) [@metawiki](https://forum.xwiki.org/u/metawiki)\
**Post date:** [July 18, 2023, 10:48am UTC](https://forum.xwiki.org/t/refresh-toc-in-sidebar-panel-on-wysiwyg-save/12841/1 "2023-07-18T10:48:09Z")

</div>

Hello everybody!

To save some space and some hassle with PDF exports, I decided to put a Table of Contents macro into the sidebar as described in [this posting](https://forum.xwiki.org/t/table-of-contents-in-a-right-panel/6843).

This works quite nice, aside from the fact that the TOC does not refresh after saving chances with the in-place WYSIWYG editor. I still have to manually reload the page to have the TOC reflect my changes to the heading structure. Our users might find that irritating, however.

What would be the least-effort approach to have the TOC macro react to page changes?

The Panel settings are as follows:  
 ![grafik](https://forum.xwiki.org/uploads/default/original/2X/5/5e442dfa600fbfe71ea2f5332353a09188e6e949.png)

Can I use async rendering and trigger a refresh rendering on editor save events with some JSX maybe?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Simpel](https://forum.xwiki.org/user_avatar/forum.xwiki.org/simpel/32/3655_2.png) [@Simpel](https://forum.xwiki.org/u/Simpel)\
**Post date:** [October 23, 2025, 3:54pm UTC](https://forum.xwiki.org/t/refresh-toc-in-sidebar-panel-on-wysiwyg-save/12841/2 "2025-10-23T15:54:56Z")

</div>

I revive this topic as I would be interested in an answer too.

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [October 24, 2025, 8:02am UTC](https://forum.xwiki.org/t/refresh-toc-in-sidebar-panel-on-wysiwyg-save/12841/3 "2025-10-24T08:02:01Z")

</div>

Yes, you’d probably need to write some javascript for your panel and listen to some javascript events we send when saving a page (`xwiki:actions:save`, see [https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/JavaScriptAPI/#HActionevents28actionButtons.js29](https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/FrontendResources/JavaScriptAPI/#HActionevents28actionButtons.js29) ).

---

<div class="post-metadata">

**Author:** ![Simpel](https://forum.xwiki.org/user_avatar/forum.xwiki.org/simpel/32/3655_2.png) [@Simpel](https://forum.xwiki.org/u/Simpel)\
**Post date:** [October 24, 2025, 5:46pm UTC](https://forum.xwiki.org/t/refresh-toc-in-sidebar-panel-on-wysiwyg-save/12841/4 "2025-10-24T17:46:32Z")

</div>

I’m currently not aware of an action to just “reload” the toc panel with javascript. Does anyone have any tips or advice for me?

---

<div class="post-metadata">

**Author:** ![vmassol](https://forum.xwiki.org/user_avatar/forum.xwiki.org/vmassol/32/6_2.png) [@vmassol](https://forum.xwiki.org/u/vmassol)\
**Post date:** [October 24, 2025, 6:29pm UTC](https://forum.xwiki.org/t/refresh-toc-in-sidebar-panel-on-wysiwyg-save/12841/5 "2025-10-24T18:29:30Z")

</div>

I think you just need to have a wiki page generating the html content of the panel and then with JavaScript , when you receive the event, you do a query to render that page’s html and then update the DOM of the panel.
