[jboss-dev-forums] [Design of JBoss Portal] - Re: processAction method not implemented
tsentih
do-not-reply at jboss.com
Tue Mar 10 22:19:04 EDT 2009
Hi,bjoernb
I had resolved this problem, I use the jboss portal 2.7.1
This is my event
@XmlRootElement
public class TestEvent implements Serializable {
private String id;
public TestEvent(String id)
{
System.out.println("Start Event");
this.id = id;
}
public String getId()
{
System.out.println("Start Event2");
return id;
}
}
And next is my set event method , I use the portlet to set event in actionlistener:
.....
ActionResponse actionResponse = (ActionResponse)responseObject;
System.out.println("aaaaaa");
QName QNAME = new QName("urn:dfi:portal:samples:event", "TestEvent");
TestEvent menueSelectionEvent = new TestEvent("start action event");
actionResponse.setEvent(QNAME, menueSelectionEvent);
...
Last, how to get the event:
@Override
public void processEvent(EventRequest request, EventResponse response)
throws PortletException, IOException {
// TODO Auto-generated method stub
System.out.println("get Event :1111111111111111111" );
TestEvent testEvent = (TestEvent) request.getEvent().getValue();
System.out.println("get Event :"+ testEvent.getId());
}
You can try it, it works...
as follow is part of my portle.xml setting :
C
<short-title>C</short-title>
</portlet-info>
<supported-processing-event>
<qname xmlns:jbp="urn:dfi:portal:samples:event">jbp:TestEvent
</supported-processing-event>
<event-definition>
<qname xmlns:jbp="urn:dfi:portal:samples:event">jbp:TestEvent
<value-type>dfi.portlet.event.TestEvent</value-type>
</event-definition>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4216832#4216832
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4216832
More information about the jboss-dev-forums
mailing list