How do I retrieve the Bookmarkable URL of a page runtime?

Since version 6 we have now the possibility to add a URL to the Page Object's properties, eg; "/home". Is there a way to retrieve the URL of this Page the user is currently viewing at runtime ?
2 answers

Yes, from in the context of any Mendix widget, there is a property called mxform. The mxform has a property called URL, which contains that page's URL.

So, as a test, open up the chrome developer tools in a Mendix app. In the elements tab, select the element of a widget on the page, for example a data view, then run this in the console:

var myWidget = dijit.registry.byNode($0)

You should get the relative page url back, something like:


I need to display Text on pages, that can be maintained and changed at runtime. I now accomplish this by using an enumeration with values for each page that requires flexible text. Each page has its own retrieve through XPATH with its own enumvalue. If I can retrieve the url, then create the XPATH and then open the page, I could e.g. do with the same snippet on each page instead of having retrieve with the specific XPATH. A bit like the no longer supported Help Text Viewer. The Bootstrap Tooltip is no option for that, because it only shows on hover, etc.