0 Replies Latest reply on Mar 7, 2006 4:38 PM by Jason O'Kelly

    Inter-portlet communication problem

    Jason O'Kelly Newbie

      Hi, I have recently been playing around with the bundled version of jboss-portal-2.2.1RC2. When doing IPC that involves actionURL's there is no problem and all works well. My problem arises when attempting to do IPC with renderURL's from portlet A to B. The listener that I have declared picks up a WindowRenderEvent with the Node name A it seems to run through the code correctly by returning the correct newEvent of node name B (as well as parameters etc are all as expected). However, for some reason when the event that was just returned gets handled by the listener again it is supposed to have the node name B, but it is still actually A.

      The following is the code for my listener. It seems to work OK in the case of WindowActionEvents but not WindowRenderEvents:

      public static class Listener implements PortalNodeEventListener
      {
      public PortalNodeEvent onEvent(PortalNodeEventBubbler bubbler,
      PortalNodeEvent event)
      {
      PortalNodeEvent newEvent = null;
      PortalNode targetWindow = null;

      // Get node and the node name
      PortalNode node = event.getNode();
      String nodeName = node.getName();

      if (nodeName.equals("SystemAdminPortletWindow"))
      {
      targetWindow = node.resolve("../UserPortletWindow");
      }

      if (targetWindow != null)
      {
      if (event instanceof WindowActionEvent)
      {
      WindowActionEvent targetEvent = null;
      WindowActionEvent currentEvent = (WindowActionEvent) event;

      // Setup the target event
      targetEvent = new WindowActionEvent(targetWindow);
      targetEvent.setMode(currentEvent.getMode());
      targetEvent.setParameters(currentEvent.getParameters());

      newEvent = targetEvent;
      }
      else if (event instanceof WindowRenderEvent)
      {
      WindowRenderEvent targetEvent = null;
      WindowRenderEvent currentEvent = (WindowRenderEvent) event;

      // Setup the target event
      targetEvent = new WindowRenderEvent(targetWindow);
      targetEvent.setMode(currentEvent.getMode());
      targetEvent.setParameters(currentEvent.getParameters());

      newEvent = targetEvent;
      }
      }

      if (newEvent != null)
      {
      // If we have a new event redirect to it
      return newEvent;
      }
      else
      {
      // Otherwise bubble up
      return bubbler.dispatch(event);
      }
      }
      }

      Any help shedding the light on this would be greatly appreciated.

      Thanks in advance.

      Jason