Open URL via Nanoflow works on click but Open Link in New Tab opens current page instead

0
Hi Team,I have a Terms of Use page in my Mendix web application. The links are configured using a Link Widget with On Click → Nanoflow, and inside the nanoflow I use the Open URL action to open different HTML files based on the user's browser language.Example:TermsofUse.html Behavior:Normal left click opens the correct HTML page.Right click → Open Link in New Tab opens the current Mendix page instead of the target HTML page.I understand that browser context menu actions may not execute nanoflows, but I would like to know:Is this expected behavior when using a Link Widget with On Click → Nanoflow?Is there any way to support "Open Link in New Tab" while still keeping the language-based URL selection logic?Would using a direct Web URL be the only recommended approach?Thanks!Reemali Patil
asked
2 answers
2

Hi Reemali,

Based on your comments, May be this full fill you requirements.


Step 1: Add an HTML Element widget to your page and set the Tag name to a. This renders a real anchor (<a>) link in the DOM — unlike a Link widget with an On Click nanoflow, this gives you a genuine "href" so things like right-click → "Open in new tab" work correctly.



Step 2: In the HTML attributes section, add a new attribute: Name = "href", Value = "your full URL".

Remember to set the Tag name to " a "


Limitation: since this is a static href, not a click-triggered nanoflow, you can't run language-detection logic on click anymore. Instead:

  • Create one HTML Element widget per language, each with its own href.
  • Use Visible if on each widget, based on the user's session language, so only the correct one shows at a time.


Now: when you click on Button the button logic will follow, but when you right click on button and do the open link in new tab the link will open new tab.

I have tested this in my application maybe this works for you.


Please mark this accepted if it helps.


answered
0

The behavior mentioned by Gopi is correct for the default Mendix Link Widget with On Click → Nanoflow.


Since Mendix applications run as a Single Page Application (SPA), the browser's native actions like Right click → Open Link in New Tab do not execute the Nanoflow logic. The URL is only generated when the click event triggers the Nanoflow, so the browser does not know the final target URL.


For cases where you need dynamic URL handling (language-based URLs, generated links, etc.), you can handle it using a URL opener approach.


I have created a small module for this scenario:


URL Opener

https://marketplace.mendix.com/link/component/226071


Typical usage:

  • Create a Nanoflow
  • Use the URL Opener action
  • Pass the URL as a string
  • Configure whether to open in:
    • Same tab
    • New tab
    • New window
    • New window with custom width/height


Kindly mark this as the accepted answer if it helps.


answered