JSF Portlet + IPC
dcshonda Jan 22, 2008 8:21 AMHi 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