Foros de discusión

How to refresh content of another portlet after serveResource

Liferay Question, modificado hace 12 años.

How to refresh content of another portlet after serveResource

thumbnail
David H Nebinger, modificado hace 12 años.

RE: How to refresh content of another portlet after serveResource

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
You could use IPC to get portlet A to post an event to portlet B in the serve resource handler, assuming you are writing both portlets A and B...
Liferay Question, modificado hace 12 años.

RE: How to refresh content of another portlet after serveResource

thumbnail
Tanweer Ahmed ., modificado hace 1 año.

RE: How to refresh content of another portlet after serveResource

Expert Mensajes: 322 Fecha de incorporación: 11/03/10 Mensajes recientes
Hi

Put this code inside the page of your portlet which you want to refresh,

 function refreshPortlet() {
    var plid = themeDisplay.getPlid();
    var nsShort = ("<portlet:namespace />".substr(1)).substr(0, "<portlet:namespace />".length-2);
    var portletId = "#p_p_id<portlet:namespace />";
    var loadId = "p_load<portlet:namespace />";
    url = "/c/portal/render_portlet?p_l_id=" + plid+ "&amp;p_p_id="+nsShort+"&amp;p_p_action=0&amp;p_p_state=normal&amp;p_p_mode=view";
    jQuery(portletId).empty().append('<div class="loading-animation" id="'+loadId+'"></div>');
    jQuery(portletId).load(url);
}


Follow this link

Hope this helps,

Regards,
Tanweer
mPowerian-BoschLer
thumbnail
Raja Nagendra Kumar, modificado hace 12 años.

RE: How to refresh content of another portlet after serveResource

Expert Mensajes: 484 Fecha de incorporación: 2/03/06 Mensajes recientes
More details on the same with example code at

http://blog.xebia.com/2009/04/inter-portlet-coordination-with-jsr-286/

section Portlet Events

Raja Nagendra Kumar.
C.T.O
www.tejasoft.com
Services 3.0 - Beyond bodies and CV selling
Liferay Question, modificado hace 12 años.

RE: How to refresh content of another portlet after serveResource

thumbnail
Raja Nagendra Kumar, modificado hace 12 años.

RE: How to refresh content of another portlet after serveResource

Expert Mensajes: 484 Fecha de incorporación: 2/03/06 Mensajes recientes
Events will be called after processAction (which is called just one for every action) and before render call.

http://www.liferay.com/community/wiki/-/wiki/Main/Portlet+to+Portlet+Communication

Server side IPC is common. I assume IPC are much easier realized by Vaadin kind of portlets. Any one with Vaddin expertise, pl. add your views.

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
thumbnail
jelmer kuperus, modificado hace 12 años.

RE: How to refresh content of another portlet after serveResource

Liferay Legend Mensajes: 1191 Fecha de incorporación: 10/03/10 Mensajes recientes
You could use clientside rpc,

fire an even when you received your response from the resource, catch it in the other portlet and trigger the refresh

see: http://www.liferay.com/community/wiki/-/wiki/Main/Portlet+to+Portlet+Communication
thumbnail
Dmitry Far, modificado hace 12 años.

RE: How to refresh content of another portlet after serveResource

New Member Mensajes: 9 Fecha de incorporación: 8/04/11 Mensajes recientes
You can fire event from Ajax-portlet to other portlets. When your portlet will catch this event, just call refresh for this portlet:

Liferay.on('doRefreshPortlet', function(data){
	Liferay.Portlet.refresh('#p_p_id<portlet:namespace />');
});
thumbnail
Oleg Efimov, modificado hace 9 años.

RE: How to refresh content of another portlet after serveResource

New Member Mensajes: 21 Fecha de incorporación: 10/07/14 Mensajes recientes
Hello everyone, are there any ideas/solutions for this question?

I still haven't found a way to fire an event from serveResource. I also failed to refresh a portlet from another portlet's serveResource (for a simple single-webapp-and-single-session case).