Introduce IComponentAwareEventSink which will pass the behavior's component as 
context to onEvent
-------------------------------------------------------------------------------------------------

                 Key: WICKET-3684
                 URL: https://issues.apache.org/jira/browse/WICKET-3684
             Project: Wicket
          Issue Type: Sub-task
          Components: wicket-core
    Affects Versions: 1.5-RC4
            Reporter: Martin Grigorov


>From the last comment by Bertrand Guay-Paquet in WICKET-3516:

I have finally gotten around to using this new feature! Ater implementing a 
first Behavior event sink, I noticed that Behavior#onEvent(IEvent<?>) is the 
only Behavior method which does not receive a reference to the attached 
Component. This means that a Behavior which wants to work on a Component when 
an Event is received must keep a reference to its Component. Because of that, 
such Behaviors cannot be reused across different components. 

Could the onEvent method signature be modified like so: 
public void onEvent(Component component, IEvent<?> event) ? 

Modifying the signature as proposed entails dropping the IEventSink interface 
as it is which complicates matters for IEventDispatcher. 

What do you think? Is there a way to work around this issue and make 
Behavior#onEvent more like other Behavior methods?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to