Topic
  • 3 replies
  • Latest Post - ‏2013-06-20T15:20:21Z by gifor
gifor
gifor
24 Posts

Pinned topic Communication for JSR 286 Faces Portlets

‏2013-05-09T21:35:42Z |

 

I'm trying to have communication for JSR 286 Faces Portlets.
My Problem is sending events from one portlet to another. Looking on Internet I found this to setEvent within a JSF Managed Bean:
PortletResponseWrapper responseWrapper = (PortletResponseWrapper)FacesContext.getCurrentInstance().getExternalContext().getResponse();
ActionResponse response = (ActionResponse)responseWrapper.getPortletResponse(); 
String text = "testo!!"; 
response.setEvent(new QName("http://Wiring/","EventName"), text);

Unfortunately I get a "Caused by: java.lang.ClassCastException: com.ibm.wps.engine.el.init.AttributeCopyResourceResponseImpl incompatible with javax.portlet.ActionResponse". How to get ActionResponse?

I use WPS 8.0.0.1 and RAD 8.5.1

Thank you!

 

 

Updated on 2013-05-09T22:01:24Z at 2013-05-09T22:01:24Z by gifor
  • gifor
    gifor
    24 Posts
    ACCEPTED ANSWER

    Re: Communication for JSR 286 Faces Portlets

    ‏2013-06-20T15:20:21Z  

    Probably I solved!

    When I use AJAX request, the serveResource method is called so the ResponseWrapper is a ResourceResponseWrapper that wraps a ResourceResponse that don't allow to set events.

    What I have to do is using a non-ajax submit, so the JSF managed bean can access the ActionResponseWrapper and set the event!

    I'm right? Any feedback on that?

  • Michele Buccarello
    Michele Buccarello
    1 Post

    Re: Communication for JSR 286 Faces Portlets

    ‏2013-05-23T21:13:08Z  

    You can try follow this link 

    http://www-10.lotus.com/ldd/portalwiki.nsf/dx/Event-based_inter-portlet_communication_with_IBM_WebSphere_Portal_and_JSR286

     

    I hope this help.

  • gifor
    gifor
    24 Posts

    Re: Communication for JSR 286 Faces Portlets

    ‏2013-05-24T18:20:11Z  

    Thank you Michele, that is the standard way to realize IPC when you work with a Portlet class and you can access the ActionResponse directly. In JSF (Faces Portlets) you only have a Managed Bean (that is a pojo class) that don't have reference to the ActionResponse object.

    Thank you anyway :)

  • gifor
    gifor
    24 Posts

    Re: Communication for JSR 286 Faces Portlets

    ‏2013-06-20T15:20:21Z  

    Probably I solved!

    When I use AJAX request, the serveResource method is called so the ResponseWrapper is a ResourceResponseWrapper that wraps a ResourceResponse that don't allow to set events.

    What I have to do is using a non-ajax submit, so the JSF managed bean can access the ActionResponseWrapper and set the event!

    I'm right? Any feedback on that?