Viewing HTML (with javascript) via vaadin app...

I have a collection of HTML files (generated with a help tool) that are the help files I want to associate to my application so that when a user clicks on the help icon, the selected HTML page is displayed. I really don’t care if its in a popup window a new browser window or a new tab in the browser that is running the application.

I can’t seem to find an example that works.

Any thoughts fellow vaadin users?

Thanks in advance,
Chuck

On the same subject, I’d like to know why the following code sample doesn’t work:

            VerticalLayout layout = (VerticalLayout) this.getContent();

	layout.setMargin(true);
	layout.setSpacing(true);
	// make it undefined for auto-sizing window
	layout.setSizeUndefined();

	String fileUrl = "file:///C:/help.html";

	Embedded emb = new Embedded("Help", new ExternalResource(fileUrl, "text/html"));
	emb.setType(Embedded.TYPE_BROWSER);
	emb.setWidth("800px");
	emb.setHeight("600px");
	
	layout.addComponent(emb);

All I get is a blank window with my “Help” caption.

Now I have been able to replace the “fileUrl” variable with a hardcoded random web page (from CNet) and I was able to display the page as well as navigate around the page a bit.

Any further thoughts?

Thanks again,
Chuck

I have the very same problem… Did you able to solve this ??

Basically I have a html file stored locally that needs to be displayed in a grid element

Embedded e = new Embedded(“Vaadin web site”,
new ExternalResource(“file://C:/temp/cartest.htm”));
e.setType(Embedded.TYPE_BROWSER);
e.setWidth(“50%”);
e.setHeight(“50%”);
grid.addComponent(e, i % mColumns, curRow);
grid.setComponentAlignment(e, Alignment.TOP_CENTER);

If I try using an external link, like wikipedia it works fine.

-CK

Vaadin is running in a server so you can’t use “file://C:/”, you need to put your files and have them served by the server, then you will have a real URL to use.
To know how to configure your server for that, you will have to check it’s guide as it may be different depending on which one you are using.