[ 
https://issues.apache.org/jira/browse/WICKET-214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12646490#action_12646490
 ] 

Bruno Borges commented on WICKET-214:
-------------------------------------

I've been trying to implement something like IMergeableBehavior, but because of 
so many specific properties each behavior can provide, I think it won't be a 
good idea.

Maybe other things must be considered to solve this:

1) Defining an IEventBehavior - which would serve for Javascript events *only*, 
like onChange, etc... 

interface IEventBehavior extends IBehavior, IHeaderContributor {
    public String getEvent();
}

2) Defining a class called AggregatedEventBehavior - which would... aggregate 
IEventBehaviors of the same event type

class AggregatedEventBehavior {
    public AggregatedEventBehavior(IEventBehavior... events) {
        ... // check for event type consistency
    }

    .. // other methos like render,  onComponentTag, etc, like in IBehavior
}

3) Only one ajax call to this aggregated behavior (avoiding multiple Ajax calls)

4) If developer choses to add more than one event of the same type to a 
component, the framework should throw an exception. If the intention is to 
actually attach more than one behavior to the same event, the developer will 
have to use an IAggregatedEventBehavior

5) The need of a new method:  Component.add(AggregatedEventBehavior)

6) Somehow, avoid the use of AttributeModifiers that refers to Javascript events

Cheers,
Bruno

> Call all behaviors attached to the same event
> ---------------------------------------------
>
>                 Key: WICKET-214
>                 URL: https://issues.apache.org/jira/browse/WICKET-214
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 1.4-M1
>            Reporter: Erik van Oosten
>            Assignee: Johan Compagner
>             Fix For: 1.5-M1
>
>
> If one adds 2 AjaxFormComponentUpdatingBehaviors with event "onchange" to the 
> same form component, only the behavior that was added last will actually be 
> called. Please make it so that both are called.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to