Mendix 5.15: widgets used in layouts only rendering once
I use a custom widget on layout level so that I don't have to place the widget on every page. In Mendix 5.9 this widget was executed (postcreate() / update()) for every new page because Mendix was loading the whole page including in layout. In 5.15 layouts are not rendered again, but only the layout containers. This is a great thing for better performance and maintaining CSS states in layouts. The only problem is with the layout widgets. How do I get them working again without having to place the widget in every page (> 1000 forms)? Can I subscribe to a formLoaded() event or something? I noticed the onAfterShow() function on _FormBase, but then you should already have the form. UPDATE 29-04. I managed to get this working by using MutationObserver checking if Mendix is replacing the mx-placeholders. If so, then execute the widget again. This code will be part of a UX manipulator widget that we'll publish soon in the app store and code will also be on Github so that anybody can implement layout level widgets which needs to be re-executed if a new form is loaded. Note: it would be so nice to have a formLoaded event coming from Mx client.. I'll file a ticket for that..