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

0
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 ?
asked
2 answers
3

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)
myWidget.mxform.url

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

/p/mycustompageURL
answered
0

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.

answered