Calling a Mendix Page using a URL link

5
We all know that a page can be called using a BUTTON in configuring its ON-CLICK property to Show a page and in choosing the page to be shown.   A page being a URL, I wonder how I could call a page in using a BUTTON which is calling a URL defined in a string variable.  Thanks for any hint  
asked
1 answers
5

From the documentation:

4.3 URL
The URL of the page can be used to directly navigate to the page (for example, from external links or bookmarks). It will be shown in the address bar of the browser when you visit the page. When navigating to a page without a URL configured, the last visited URL is shown. Note that the full URL of the page will be the base URL of your application followed by /p and then by the configured URL of the page (for example, http://example.mendixcloud.com/p/home_page).

Pages with top-level data views (parameterized pages) can also have URLs. The URL property of such pages should contain the {Id} path segment at the end. In the browser, the {Id} segment will be replaced with the actual identifier of an entity.

In simple e-commerce applications, the URLs can be configured as follows:

/orders/ – the URL for a page with a data grid for Orders (in a browser, the URL will look like http://example.mendixcloud.com/p/orders/)

/order/{Id} – the URL for a page with data from a particular Order (actual URLs in a browser will look like http://example.mendixcloud.com/p/order/3212449487634321, wherein 3212449487634321 is the unique identifier of the Order)

See https://docs.mendix.com/refguide/page

By defining the URL property of your page the page is directly accesible through the url.

You then have 2 options:

1) Use a link button with the address property set to an attribute containing the url of the page you set like in the documentation

2) For more flexibility add an action button calling a microflow. In the microflow create an temporary object with 1 attribute. Fill the attribute with the desired URL according to your microflow logic. Then create a page with the url redirector widget on it (https://appstore.home.mendix.com/link/app/113/Mendix/URL-Redirector) and make sure it uses the attribute with the url. Then as last action in your microflow open the newly created page containing the temporary object. This will redirect you to the desired page.

Hope this helps in finding the solution.

answered