I was actually trying to explain this approach in my first comment as well, but I may not have explained it clearly enough.
When I try it in the way you can see in my screenshot, it works without any errors. However, when I implement it the way you did, I run into the error.
Another approach could be to use the HTML Element widget to inject the iFrame HTML directly into your page.
https://docs.mendix.com/appstore/widgets/htmlelement/
You can define the iframe HTML, and then pass the src attribute as a parameter that you can generate it dynamically and pass in. This would need to be passed as an attribute in an entity used in a containing DataView.
Set the Content attribute to HTML and then edit the HTML. Similar to Ahmet's suggestion, set the Template to be
<iframe src="{1}" width="450" height="200" frameborder="0"></iframe>
You can now set the first parameter to be the URL of your iFrame.
As an iFrame may be seen as unsafe, you also have to set the HTML Sanitization in the Advanced tab to allow the iFrame.
{
"ALLOWED_TAGS": ["iframe"]
}
I hope this helps. Good luck!
One possible approach is to build the iframe URL as a String in Mendix (for example via a microflow or helper entity) and then render it using a Text widget with Render mode set to HTML. This allows you to dynamically inject query parameters using template expressions.
For example, you can construct the URL in a microflow and then use it in the Text widget like this:
<iframe src="[% URL %]" width="450" height="200" frameborder="0"></iframe>
Hopefully, this would work well for passing query parameters to an iframe in Mendix.
Have you tried this approach?
You can also consider the IFrame Component from the Mendix Marketplace. It supports setting the iframe Src as an expression, so you can build the URL (including urlEncode() for parameters like Work_Center/Line) in Mendix and pass it directly to the widget.