You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Gaetan Zoritchak <g....@virtual-soft.com> on 2010/11/22 00:18:43 UTC

As Compenont.remove(IBehaviour) use IBehaviour.equals() shouldn't equals be implemented in every behaviour?

Hi,

All is in the message object ;)

For my development, I wanted to remove a behaviour on the AjaxEditableLabel
in some cases. It didn't work since the equals method wasn't implemented. I
had to modify the source code to make it work.

Thanks for the replies,
Gaetan,

Re: As Compenont.remove(IBehaviour) use IBehaviour.equals() shouldn't equals be implemented in every behaviour?

Posted by Gaetan Zoritchak <g....@virtual-soft.com>.
You're right. Thank you for the time spent.
Gaetan

2010/11/22 Igor Vaynberg <ig...@gmail.com>

> sure its possible, you can iterate the list of behaviors and look for
> an event behavior with event==onclick
>
>
> trying to remove a behavior not directly associated with the component
> would be...weird.
>
> -igor
>
> On Sun, Nov 21, 2010 at 3:26 PM, Gaetan Zoritchak
> <g....@virtual-soft.com> wrote:
> > In my case it's not possible as I extend the AjaxEditableLabel and the
> > Behaviour is added without keeping a reference on it.
> > I want to remove the "onclick" behaviour sometimes but it's impossible.
> >
> > 2010/11/22 Igor Vaynberg <ig...@gmail.com>
> >
> >> if equals is not implemented then it falls back on identity. it makes
> >> sense that if you want to remove an instance of ibehavior from a
> >> component then you should have that exact instance.
> >>
> >> -igor
> >>
> >> On Sun, Nov 21, 2010 at 3:18 PM, Gaetan Zoritchak
> >> <g....@virtual-soft.com> wrote:
> >> > Hi,
> >> >
> >> > All is in the message object ;)
> >> >
> >> > For my development, I wanted to remove a behaviour on the
> >> AjaxEditableLabel
> >> > in some cases. It didn't work since the equals method wasn't
> implemented.
> >> I
> >> > had to modify the source code to make it work.
> >> >
> >> > Thanks for the replies,
> >> > Gaetan,
> >> >
> >>
> >
>

Re: As Compenont.remove(IBehaviour) use IBehaviour.equals() shouldn't equals be implemented in every behaviour?

Posted by Igor Vaynberg <ig...@gmail.com>.
sure its possible, you can iterate the list of behaviors and look for
an event behavior with event==onclick


trying to remove a behavior not directly associated with the component
would be...weird.

-igor

On Sun, Nov 21, 2010 at 3:26 PM, Gaetan Zoritchak
<g....@virtual-soft.com> wrote:
> In my case it's not possible as I extend the AjaxEditableLabel and the
> Behaviour is added without keeping a reference on it.
> I want to remove the "onclick" behaviour sometimes but it's impossible.
>
> 2010/11/22 Igor Vaynberg <ig...@gmail.com>
>
>> if equals is not implemented then it falls back on identity. it makes
>> sense that if you want to remove an instance of ibehavior from a
>> component then you should have that exact instance.
>>
>> -igor
>>
>> On Sun, Nov 21, 2010 at 3:18 PM, Gaetan Zoritchak
>> <g....@virtual-soft.com> wrote:
>> > Hi,
>> >
>> > All is in the message object ;)
>> >
>> > For my development, I wanted to remove a behaviour on the
>> AjaxEditableLabel
>> > in some cases. It didn't work since the equals method wasn't implemented.
>> I
>> > had to modify the source code to make it work.
>> >
>> > Thanks for the replies,
>> > Gaetan,
>> >
>>
>

Re: As Compenont.remove(IBehaviour) use IBehaviour.equals() shouldn't equals be implemented in every behaviour?

Posted by Gaetan Zoritchak <g....@virtual-soft.com>.
In my case it's not possible as I extend the AjaxEditableLabel and the
Behaviour is added without keeping a reference on it.
I want to remove the "onclick" behaviour sometimes but it's impossible.

2010/11/22 Igor Vaynberg <ig...@gmail.com>

> if equals is not implemented then it falls back on identity. it makes
> sense that if you want to remove an instance of ibehavior from a
> component then you should have that exact instance.
>
> -igor
>
> On Sun, Nov 21, 2010 at 3:18 PM, Gaetan Zoritchak
> <g....@virtual-soft.com> wrote:
> > Hi,
> >
> > All is in the message object ;)
> >
> > For my development, I wanted to remove a behaviour on the
> AjaxEditableLabel
> > in some cases. It didn't work since the equals method wasn't implemented.
> I
> > had to modify the source code to make it work.
> >
> > Thanks for the replies,
> > Gaetan,
> >
>

Re: As Compenont.remove(IBehaviour) use IBehaviour.equals() shouldn't equals be implemented in every behaviour?

Posted by Igor Vaynberg <ig...@gmail.com>.
if equals is not implemented then it falls back on identity. it makes
sense that if you want to remove an instance of ibehavior from a
component then you should have that exact instance.

-igor

On Sun, Nov 21, 2010 at 3:18 PM, Gaetan Zoritchak
<g....@virtual-soft.com> wrote:
> Hi,
>
> All is in the message object ;)
>
> For my development, I wanted to remove a behaviour on the AjaxEditableLabel
> in some cases. It didn't work since the equals method wasn't implemented. I
> had to modify the source code to make it work.
>
> Thanks for the replies,
> Gaetan,
>