Portlet events can only be sent from action or render requests. As user actions in a Vaadin application are sent to the server as resource requests, Vaadin has to create a new action request, reload the page with it and send the event from there.
Note that in many cases, the receiving portlet would need a page reload anyway to display the effects of the event.
There might also be a little information in
the book
, although not much on this specific topic.
A little background (from memory, I did not check the JSR-286 spec) for those interested on how different request types are currently used by Vaadin and to a large extent in JSR-286 portlet containers in general:
When a portal page is loaded, there are two main processing phases: action processing and rendering. First, all portlets receive any actions that are relevant to them. IIRC, this may happen in parallel. Then, when all portlets have processed all the relevant actions (possibly creating events, making changes to shared render parameters etc.), the render phase follows. Again, all portlets receive a render request, which the portal can choose to send in parallel or in sequence. The HTML fragments to show in the portlets are generated in the render phase.
When portlet events are sent, there is an additional event processing âphaseâ between the action and render phases. In practice, this may happen in parallel with the action processing phase or not, and events may be processed immediately when they are sent or queued, but all events to all portlets on the page are processed before the render phase.
In Vaadin applications, JSON requests from the client to the server (user actions) are handled as resource requests, which do not trigger this full reload. However, as there are no action processing and and render phases, there is no event processing either. Vaadin gets around this by creating a new action request that identifies the event to send (or shared render parameter change to make) and then telling the client side to reload the page with that action. This special action is intercepted before Vaadin calls PortletListeners, and processed by sending the event or making the render parameter change.
A render request for a Vaadin portlet just creates a small HTML fragment that loads the widgetset, which will then contact the server to ask for the content (in terms of Vaadin widgets) of the portlet.