Is it possible to have 2 vaadin portlets on the same page?

Have not received any responses from previous posts similar to this one. So I want to provide a little more detail.

Is it possible to have 2 vaadin portlets on the same page using Vaadin 7 (Beta)?

I have the following entries in portlet.xml.

<portlet>
	<portlet-name>hello</portlet-name>
	<display-name>hello</display-name>
	<portlet-class>com.vaadin.server.VaadinPortlet</portlet-class>
	<init-param>
		<name>UI</name>
		<value>org.soa4j.hello.ui.HelloOneUI</value>
	</init-param>
</portlet>

<portlet>
	<portlet-name>hello2</portlet-name>
	<display-name>hello2</display-name>
	<portlet-class>com.vaadin.server.VaadinPortlet</portlet-class>
	<init-param>
		<name>UI</name>
		<value>org.soa4j.hello.ui.HelloTwoUI</value>
	</init-param>
</portlet>

When I have more than 1 Vaadin portlet on the page, I get the following error and the portlet does not render.

JavaScriptException: (TypeError) : Cannot call method 'ke' of null

If the Vaadin portlet is the only Vaadin portlet on the page, then the portlet works great. Does not matter which Vaadin portlet as long as there is only one.

Is this a known bug? Could not find it in the issue system. Or am I doing something wrong like missing a configuration?

Yes, it should be possible. If it is not, then it is a bug.

Your configuration looks ok. Have you doublechecked that your widgetset is also from beta1? If so, please create a ticket at
http://dev.vaadin.com
and we will have a look at it. If you want to help out you could compile the widgetset using pretty mode and get a stack trace that is not obfuscated.

Yes. It is from beta 1.

JavaScriptException: (TypeError) : Cannot call method ‘loaded__V’ of null


http://dev.vaadin.com/ticket/9648

So it looks like the nightly build as of Sept 21 fixes the rendering problem. I can now display multiple vaadin portlets on the same page. However, only one of the vaadin portlets can properly handle ajax calls to the server (resource requests). When I click on a button from the first portlet to display a notification, it works. All other vaadin portlets generate the following error…

Communication problem
Take note of any unsaved data, and click here to continue.
(SyntaxError) : Unexpected token ) - Original JSON-text:

I realize it is a nightly build, but I was also getting this same behavior in alpha 3 build.

Would you like me to create a bug issue on this as well?

So I did a little more digging and this is what I found.

The actual error that is thrown is an InvalidUIDLSecurityKeyException with the message “Security key mismatch”. This happens when XSRF is enabled, which it is by default. If I disable it by setting the disable-xsrf-protection to true, I don’t get any exception anymore. However, when I click on the button on the 2nd or 3rd vaadin portlet, it executes the buttonClick event of the first vaadin portlet.

I created the following issue.


http://dev.vaadin.com/ticket/9757

There was an issue (actual multiple issues) in beta1 which caused a portlet to some times send its requests to another portlet. This has been fixed in beta2. If there are still issues, please report them as new tickets.

I just tried Vaadin 7 (beta 2) and all seems to be working. Thanks!