CustomLayout + split pane + openlayers

Hi all
I am trying to show maps using openlayers Javascript API in a pane of a split bar in vaadin application.
For the next custom layout:

custom_layout_with_js.html

Hello World in the body

I load it:

InputStream layoutFile = getClass().getResourceAsStream(“./custom_layout_with_js.html”); //from the src directory.
CustomLayout customLayout = new CustomLayout(layoutFile);
verticalSplit.setSecondComponent(customLayout);

and I the alert and the body contents in the pane of the split bar.

Now I want to show/draw the map on the pane canvas and I changed the custom layout for this:

custom_layout_with_js.html

OpenLayers Example

I load it in the same way:

InputStream layoutFile = getClass().getResourceAsStream(“./custom_layout_with_js.html”); //from the src directory
CustomLayout customLayout = new CustomLayout(layoutFile);
verticalSplit.setSecondComponent(customLayout);

But nothing is shown in the split bar pane.

So, can the openlayers Javascript code (downloaded on the fly) draw maps in the split pane?

What is wrong?

Thanks a lot

Alex

Env: glassfish
I am using the custom layout aproach because I have huge javascript files already written in order to show maps with lots of features.

Try to extend ApplicationServlet and override writeAjaxPageHtmlVaadinScripts method by calling

super.writeAjaxPageHtmlVaadinScripts 

and then adding this line:

page.write("<script src='http://openlayers.org/api/OpenLayers.js'></script>");

It allows you to add your scripts to the page (I tried this when I needed to add jQuery). After this, you can use your script in CustomLayout. And don’t forget to change servlet class in web.xml (specify your servlet class).