Marketplace Module: iFrame Mendix in Teamcenter AWC

0
Hello Mendix Community,we have implemented the Marketplace Module: "iFrame Mendix in Teamcenter AWC" (Release: V 2.0.1) in our Mendix App (Version: 10.24.4, on-prem).The iFrame integration is completly fine and we can start and run a Mendix page in an iFrame of Teamcenter Quality.In addition we also want to start the same Mendix App as standalone App (link to the Mendix server, standard login page).For the iFrame functionality it's required to set "ApplicationRootUrl" , e.g. http://siemensdc:3000/mxapppath/But with this setting it's not possible anymore to start the App as standalone App.Are there any ideas how we can achieve to run the App in both modes (iFrame and standalone) ?Thank you very much in abdvance.Best regardsUwe
asked
2 answers
1

Hi Uwe


Great question, Uwe. This is a classic dual-deployment challenge when integrating Mendix with Teamcenter AWC via iFrame.The ApplicationRootUrl constant is a static server-side setting that Mendix uses to construct absolute URLs (deep links, callbacks, etc.). When hardcoded to the Teamcenter-facing URL, the standalone access breaks because the root URL no longer resolves correctly for direct browser access and vice versa. The best method to resolve this is by using reverse proxy/nginx in front of your Mendix server that routes traffic based on the request origin or path.

# NGINX example
server {
    listen 80;

    # Teamcenter AWC iFrame traffic
    location /mxapppath/ {
        proxy_pass http://mendix-server:8080/;
        proxy_set_header X-Forwarded-Host siemensdc:3000;
    }

    # Standalone traffic
    location / {
        proxy_pass http://mendix-server:8080/;
    }
} 

Set ApplicationRootUrl to the publicly accessible standalone URL.The reverse proxy handles the path rewriting for the iFrame context.Both entry points hit the same Mendix runtime

I hope this helps
answered
0

Hi,


This behavior is expected because ApplicationRootUrl is being treated as a static configuration, which forces the app to always assume it is running inside the iFrame context.

To support both iFrame (Teamcenter AWC) and standalone modes, you should avoid hardcoding this value and instead make the behavior dynamic based on the request context.


approach

1. Do not hardcode ApplicationRootUrl globally

Keep it empty or set it to the default base URL of your Mendix app.

2. Detect iFrame vs standalone at runtime

You can determine whether the app is running inside an iFrame using client-side logic:


if (window.self !== window.top) {
    // Running inside iFrame
} else {
    // Standalone mode
}

3. Pass context to Mendix (via URL or parameter)

From Teamcenter, launch the Mendix app with a parameter, for example:

https://your-mendix-app/?mode=iframe

4. Handle behavior in Mendix (microflow/nanoflow)

  • Read the mode parameter
  • Store it in a helper entity or session variable
  • Based on this:
    • Apply iFrame-specific logic (e.g., URL handling, navigation)
    • Or use normal standalone behavior

5. Adjust URL handling dynamically

Instead of relying on ApplicationRootUrl, compute URLs dynamically:

  • Use relative paths where possible
  • Or construct URLs based on the detected mode

Alternative (if module strictly requires ApplicationRootUrl)

If the marketplace module strictly depends on it:

  • Maintain two configurations (e.g., via constants)
  • Switch behavior using:
    • Environment-specific constants, or
    • A custom wrapper around the module logic

ApplicationRootUrl should not be fixed if you need dual-mode support. The correct approach is to detect the runtime context (iFrame vs standalone) and adjust behavior dynamically, typically via URL parameters or client-side checks. This allows the same Mendix app to function correctly in both scenarios without breaking standalone access.


answered