adding iframe with external html

After I had lost a lot of time and nerves trying to get some things in Generic/Web UI, I found out that CUBA has (not yet very well documented) Polymer support and I’ve taught that this could be the solution for my problems. And it really could be because I got it working, and in company with PDFKit, I even managed to generate nice PDFs reports and invoices using Polymer.

Now I just wanted to insert iframe that would show invoice preview while in Generic UI, but I don’t know how to add




with external src (link to polymer page) into my XML screen.

Can anyone provide me some example for that? Like Screen with frame showing “”? :slight_smile:

Hello, Igor!

You can use Embedded component for such purpose. For example:

<window xmlns=""
        <embedded id="embedded"

public class WebEmbeddedFrame extends AbstractFrame {

    private Embedded embedded;

    public void init(Map<String, Object> params) {
        try {
            embedded.setSource(new URL(""));
        } catch (MalformedURLException e) {
            throw new RuntimeException(e.getMessage(), e);



1 Like

Thank you Gleb. I’ve overlooked Embedded component while searching trough Studio’s components. Probably because I was expecting that component would have something like


property and that it would try to make our life simpler by enabling us to just enter URL to web page or image.

Unfortunately, that would be too simple and too intuitive… Another of Cuba’s rough edges. :frowning:

Actually, you can use src. My previous example can be rewritten as follows:

<embedded id="embedded"

Or if you want to show an image:

<embedded id="image" src="theme://images/cuba-logo.png"/>



1 Like

This one makes more sense :slight_smile:

Before I tried adding this kind of URLs to


but it didn’t work so I gave up.

Now when I look at it with inspector I see I got errors in the console because I’ve used url:// for testing, and that URL was blocked (sameorigin error).


Refused to display '' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
com.haulmont.cuba.web.toolkit.ui.WidgetSet-0.js:2629 GET net::ERR_BLOCKED_BY_RESPONSE

When I use my local Polymer link or link then it works.

You’re right, some web pages prevent showing them inside iframe for security reasons.