Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3516 Add behaviors to the event processing chain
  3. WICKET-3692

Providing bound Component to Behavior's onEvent()

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 1.5-RC4
    • 1.5-RC5
    • wicket

    Description

      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 it. 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?

      Attachments

        Issue Links

          Activity

            People

              ivaynberg Igor Vaynberg
              berniegp Bertrand Guay-Paquet
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: