-
1. Re: Inter-portlet communication - ajax call scope
vstorm83 Apr 23, 2012 10:24 PM (in response to infoni)Actually, GateIn currently doesn't use serveResource to process AJAX actions of portlets. To make an actions with ajax call, add "ajaxRequest=true" query parameter to your action url --> only the portlets that is triggered processAction or processEvent will be rerendered. Your portlet response will be wrapped in a predefined structured xml document, and then portal JS (PortalHttpRequest.js in eXoResources.war) will find and update your portlet html on the page
I think the easiest way is to use WebUI framework that come with GateIn (you should reference an example portlet : GateIn/testsuite/webuibasedsamples)
-
2. Re: Inter-portlet communication - ajax call scope
infoni Apr 24, 2012 7:31 PM (in response to vstorm83)Thanks for your quick response Vu, i would love make this ajax feature work.
I created in a simple jsp this action URL, with the ajaxRequest=true parameter
<portlet:actionURL var="actionURL">
<portlet:param name="action" value="event"/>
<portlet:param name="ajaxRequest" value="true"/>
</portlet:actionURL>
When this actionURL is triggered, in the processAction method i log the request parameter map and i can confirm that it contains the ajaxRequest=true parameter. However even with this parameter, there is a full page render and i still read in the catalina log:
Apr 25, 2012 12:43:53 AM org.exoplatform.portal.webui.application.UIPortletActionListener$ProcessEventsActionListener execute
INFO: Events were generated outside the scope of an AJAX call, hence will make a full render of the page
I may have something more to setup to make it work?
My portlet must run on several portals, so i should not be able to use the gatein WebUI framework: i try to make it work only with the JSR 286 api and jQuery.
thanks