Open a microflow with a page in a new tab On click of navigation item

0
On Navigation, i have menu items whose on click action is Microflow which in turns opens a page called inside this Microflow. Here I would like to open this page in a new tab. So the summary is that through the Navigation , if its clicked , it should at the end open the page in new tab which is through a Microflow. What is the best way to open a page in a new tab ? I’d rather not open it as a pop-up. And  my application has SSO setup Also I am unable to find URLRedirector Widget in Mendix 8.6.4 ? How should i solve this case ?  
asked
1 answers
2

The best way I can think of is by calling a Nanoflow from your Navigation

Step 1: Configure a URL for the desired page 


Step 2: In a Nanoflow construct the URL in a String

Step 3: Create a Javascript Action with a String Parameter ‘Url’ and the following code ( which is a modication from the OpenURL action in Nanoflow commons and only works for web browsers):

// This file was generated by Mendix Studio Pro.
//
// WARNING: Only the following code will be retained when actions are regenerated:
// - the import list
// - the code between BEGIN USER CODE and END USER CODE
// - the code between BEGIN EXTRA CODE and END EXTRA CODE
// Other code you write will be lost the next time you deploy the project.
import { Big } from "big.js";

// BEGIN EXTRA CODE
// END EXTRA CODE

/**
 * Opens the provided URL in the web browser in a new tab.
 * @param {string} url - This field is required.
 * @returns {Promise.<boolean>}
 */
export async function OpenURLInNewTab(url) {
	// BEGIN USER CODE
    if (!url) {
        return Promise.reject(new Error("Input parameter 'Url' is required"));
    }
    // Native platform
    if (navigator && navigator.product === "ReactNative") {
        const Linking = require("react-native").Linking;
        return Linking.canOpenURL(url).then(supported => {
            if (!supported) {
                return false;
            }
            return Linking.openURL(url).then(() => true);
        });
    }
    // Hybrid platform
    if (window && window.cordova) {
        window.open(url, "_system");
        return Promise.resolve(true);
    }
    // Web platform
    if (window) {
          window.open(url,'_blank');
        return Promise.resolve(true);
    }
    return Promise.resolve(false);
	// END USER CODE
}

 

answered