Creating Liferay Portlets using Vaadin

Is anyone aware of performance issues or any issue in having multiple portlets on a single page that have been developed using Vaadin? I know this depends on the implementation of the portlets, but what I am after is the loading of javascript used by Vaadin.

Some limitations:

When you have multiple Vaadin portlets on a page, they must use the same widgetset (GWT limitation). The widgetset should only be specified in the portal wide configuration, and is only loaded once for the page.

Each theme specified either by the shared configuration on the portal or the portlets itself is loaded exactly once. Note, though, that imports in the portlet specific themes can cause the same CSS rules to be loaded multiple times. If using portlet specific themes, you can remove the import from them if it is for the same as the the portal-wide one.

Themes are not automatically constrained to only affect the portlet they were set for, but affect the whole page. It is a good idea to make portlet specific theme rules always constrain themselves to elements within some style name you set e.g. for the top-level layout of the portlet.

Thanks for the info. Very useful. Have another question. Is it possible to update the UI of a Vaadin portlet from another Vaadin portlet on the same page?

The usual way to do inter-portlet communication is portlet actions and events, as well as shared render parameters (JSR-286 - portlet 2.0 spec). You can take a look at
the book chapter on portlets
for some information about using actions and events in Vaadin portlets, and there are some examples in
our SVN
as well as the Vaadin demo WAR package. Note, though, that sending one from a resource request (which the Vaadin Ajax requests are) normally requires a page refresh in the browser.

You can also look for some more info on portlet events in the forum. I would recommend you read about the phases of processing a request in JSR-286 portlets if you are not very familiar with these, e.g.
here (found with Google)
or in the
JSR-286 spec
. I had a link to a good page on these, but cannot find it right now… Briefly, the action processing phase is followed by rendering of all portlets, and events work in a similar manner.

Alternatively, you can look at any inter-application communication technology you prefer, and handle refreshes yourself.

Technically, it might be possible to directly update the state of another portlet (in the same WAR) if you get hold of the application instance and do proper synchronization, and the portlet refreshes itself regularly. I would not recommend this approach, though.