2 Replies Latest reply on Mar 10, 2008 5:45 AM by Shimon Lifshitz

    JSF Portlet + IPC

    David Corrales Newbie

      Hi everyone!

      Please, help me. I have a problem with IPC Portlets + JSF + Seam. I am new in JBoss Seam and portlets and I am not very sure, what I am doing bad...

      I have two JSF Portlets: Portlet A and Portlet B. I have a listener in portlet B, and it works fine.

      My problem is that I have a <h:commandLink ...> in Portlet A, and I want to send data to Portlet B when I push the commandLink. My problem is that Portlet B does not get data from Portlet B.

      Portlet A: (BuscadorOperacionesWindow)

      
      <h:dataTable id="tablaOperaciones" value="#{expedientes}" rows="10" class="blue-table" border="1" var="op">
       <h:column>
       <f:facet name="header">#{messages.expediente}</f:facet>
       <h:commandLink value="#{op.operacionId}" action="#gestorexpediente.enviaDatos(op.operacionId)}" >
       <f:param name="datoOp" value="#{op.operacionId}" />
       </h:commandLink>
       </h:column>
       ...
      


      Portlet B: (VisorOperacionWindow)

      <h:panelGrid columns="2">
       <h:outputLabel value="#{messages.operacion}"/>
       <h:outputLabel id="datoOp"/>
       ...
      


      Listener - Portlet B


      public class PortletB extends GenericPortlet
      {
       public static class Listener implements PortalNodeEventListener
       {
       public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
       {
       PortalNode node = event.getNode();
       String nodeName = node.getName();
      
       WindowActionEvent newEvent = null;
      
       if (nodeName.equals("BuscadorOperacionesWindow") && event instanceof WindowActionEvent)
       {
      
       WindowActionEvent wae = (WindowActionEvent) event;
       PortalNode windowB = node.resolve("../VisorOperacionWindow");
       if (windowB != null)
       {
       newEvent = new WindowActionEvent(windowB);
       newEvent.setMode(wae.getMode());
       newEvent.setWindowState(wae.getWindowState());
      
       Map parametros = (Map)wae.getParameters();
       for (Iterator keyValuePairs = parametros.entrySet().iterator(); keyValuePairs.hasNext();)
       {
       Map.Entry entry = (Map.Entry) keyValuePairs.next();
       Object key = entry.getKey();
       Object value = entry.getValue();
       if(key.equals("datoOp"))
       {
       HashMap param = new HashMap();
       param.put(key, value);
       newEvent.setParameters(param);
       return newEvent;
       }
       }
       return context.dispatch();
       }
       }
       return context.dispatch();
       }
       }
      }
      


      Anyone, can help me, please.

      Thanks very much


        • 1. Re: JSF Portlet + IPC
          marcus sim Newbie

          Hi,

          I have similar question to this. Any jboss portal expert know whether this is possible to be done?
          Thanks.

          • 2. Re: JSF Portlet + IPC
            Shimon Lifshitz Newbie

            Have same problem here.
            I have two portlet one JSF and the other regular portlet. I defined the listener on the regular portlet and try to change it based on submited value from the jsf portlet.
            The problem is that second portlet is fired but nothing is happened in the original jsf, the command isn't fired.
            Is it true that when you activating IPC the action is not performed for the caller portlet but just for the target portlet?