Inter portlet communication
[Logo]
Forums for ICEfaces and ICEpdf
[Search] Search   [Recent Topics] Recent Topics   [Groups] Home Page | www.icefaces.org  [Register] Register  [Login] Login 
Inter portlet communication  XML
Forum Index -> Portals & Portlets
Author Message
Passero

Joined: 07/02/2010 00:00:00
Messages: 12
Offline


As far as i know, the icefaces implementation of the portlet bridge supports JSR 168 but not JSR 286 which enabled communication between portlets using parameters or events.

I know some vendors who support JSR 168 but not 286 have their own method of inter portlet communication.
Does icefaces have something so i can pass parameters, object or events from one portlet to another?

Suppose i have a portlet that shows a dataTable and i have another portlet were the user can edit the row selected. How can i achieve this using the icefaces framework?

I am using this on a liferay portal 5.2 by the way.
caioformiga

Joined: 12/10/2009 00:00:00
Messages: 9
Offline


Dude, I was hading headache to do something similar... then after read doc and a few posts at forum such as this one, I just followed the instructions in this link http://www.icefaces.org/JForum/posts/list/14125.page and it works.

If after reading you can't do, post here again that I will give more tips, but generally speaking you must do:
1 - define a managed-bean with application scope (avoid huge Object, instead of that, in a scenario described just the id (primary key) from your table should be enough) which will store the product from user/application interaction,
2 - then in your jsp/jpsx/xhtml page use normal Expression Language as {#appBeanName.value} to store the value.
3 - use the code below to store this value at the PortletSession APPLICATION_SCOPE
Code:
 // I defined this methods as static cause they are encapsulated in an Util class to handle/ //manager the IPC using AjaxPush. 
 public static Object getPortletSessionAttribute(String key){
 		Object portletSessionAttribute = null;		
 		Object sessObj = FacesContext.getCurrentInstance().getExternalContext().getSession(false);                
         if (sessObj instanceof PortletSession) {
              PortletSession portletSess = (PortletSession) sessObj;
              portletSessionAttribute = portletSess.getAttribute(key, PortletSession.APPLICATION_SCOPE);        									
              System.out.println(">>>>>>>>> portletSessionAttribute stored at \n"
  		 			+"portlet session: "+ ((PortletSession) sessObj).getPortletContext().toString()
   					+"\n name: "+key
  		 			+"\n value "+portletSessionAttribute.toString());	                        
         }
 		return portletSessionAttribute;
 	}
 

4 - finally use the code below to retrieve the stored value from PortletSession
Code:
 // I defined this methods as static cause they are encapsulated in an Util class to handle/ //manager the IPC using AjaxPush. 
 public static void setPortletSessionAttribute(String key, Object value){
 		Object portletSessionAttribute = null;		
 		Object sessObj = FacesContext.getCurrentInstance().getExternalContext().getSession(false);                
         if (sessObj instanceof PortletSession) {
              PortletSession portletSess = (PortletSession) sessObj;
              portletSess.setAttribute(key, value, PortletSession.APPLICATION_SCOPE);        									
              System.out.println(">>>>>>>>> portletSessionAttribute stored at \n"
             		 			+"portlet session: "+ ((PortletSession) sessObj).getPortletContext().toString()
              					+"\n name: "+key
             		 			+"\n value "+value.toString());	            
         }		
 	}
 




 
Forum Index -> Portals & Portlets
Go to:   
Powered by JForum 2.1.7ice © JForum Team