Thank you Tor:
I am using wicket 1.4.5. I was able to find some examples for events
but I am having difficulties getting my code to work with wicket. Here's a
refrence:
http://blog.xebia.com/2009/04/19/inter-portlet-coordination-with-jsr-286/

In my code I am trying to send the event from onClick, which I
think, resulting in an exception: 

WicketMessage: Method onLinkClicked of interface
org.apache.wicket.markup.html.link.ILinkListener targeted at component
[MarkupContainer [Component id = link]] threw an exception

Root cause:

java.lang.IllegalArgumentException: Payload has not the right class at
org.apache.jetspeed.events.EventCoordinationServiceImpl.createEvent(EventCoordinationServiceImpl.java:98)
 at
org.apache.jetspeed.container.providers.EventProviderImpl.createEvent(EventProviderImpl.java:49)
 at
org.apache.pluto.container.impl.StateAwareResponseImpl.setEvent(StateAwareResponseImpl.java:140)
 at
com.sardonyxsolutions.automotive.ReportSelectorView$1.onClick(ReportSelectorView.java:25)
at org.apache.wicket.markup.html.link.Link.onLinkClicked(Link.java:224)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)


And here's the correspoinding part of my code:

public ReportSelectorView() {
    add(new Link<String>("link") {
        @Override
            public void onClick() {

                PortletRequestContext context = (PortletRequestContext) 
RequestContext .get();
                ActionResponse response = (ActionResponse) context 
.getPortletResponse();
                QName qname = new QName("http://example.com";, "ReportName");
                ReportType report = new ReportType();
                report.setReportPath("SomePath");
                response.setEvent(qname, report);
                System.out.println("Sending Event");
            }
        });
}


What I think I need to do, is to create an event within
processAction(request,responce) method in the portlet. The problem would
be to create an action event URL. 
I am still playing around trying to find my way. If you have any idea
please let me know. By the way, I am new to wicket, and I still don't
fully understand the concept of Models. Do you think Models can help
keeping the code simple and somving the issue in this case ? 

Any idea or advice, is highly appreciated.




On Tue Jan 05,2010 11:50 am, Wilhelmsen Tor Iver wrote:
> > I am having a problem finding a resource or an example for portlets
> > communications with events "processEvent(EventRequest request,
> > EventResponse response)"
> > how do I dispatch and event from wicket page? for example if I have a
> > ViewPage and I need to send an event to a subscribed portlet , how do
> > I do it ?
> 
> It seems WicketPortlet does not override GenericPortlet.processEvent() at 
> least as of 1.4.3; try subclassing WicketPortlet and add 
> @ProcessEvent(eventname) annotation to a method of your own.
> 
> As for routing you should be able to configure that in your container 
> combined with the relevant elements in portlet.xml. Dispatching is done via 
> the PortletResponse.setEvent() as the spec says.
> 
> - Tor Iver
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to