Hi Herbert,
This a part of my code in the data grid extension. Could be that aspect is not loaded, than you need to require it.
Not sure; but think that you can only place aspect account a instantiated object and not a prototype.
require(["dojo/aspect", "dojo/_base/lang"], function( aspect, lang) {
aspect.after(this.grid, "fillGrid", lang.hitch(this, this.updateEmptyTable));
});
https://github.com/Andries-Smit/DataGridExtention/src/DataGridExtension/widget/EmptyTable.js#L31
Alternatively you could go back to old school dojo with dojo/_base/connect
var handle = dojo.connect(myInstance, "execute", callback);
...
dojo.disconnect(handle);
I hate digging up old threads, but I felt I should include this info here for others (like me) who found this question via search:
In Mendix 6, there is a function called onNavigation
on mxui/lib/form/ContentForm
that you can use to catch page transitions. The onBeforeShow, onAfterShow, onBeforeHide, and onAfterHide functions don't get called anymore. I think this is because Mendix doesn't completely unload and reload forms anymore - instead it replaces the content that is necessary, keeping layouts intact.
So, something like this works for me on Mendix 6.5.1:
aspect.after(this.mxform, "onNavigation", function(){
alert('navigation occurred');
});
I will file a ticket to update documentation accordingly.