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());
}
}