You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Vitaly Tsaplin <vi...@gmail.com> on 2012/12/12 16:06:51 UTC

Add/remove AbstractAjaxBehavior

Hi,

It looks like it is not possible to remove an instance of
AbstractAjaxBehavior. The behavior keeps reference to a component it was
attached to and doesn't override unbind so it doesn't clear this reference.
On every subsequent attempt to attach it throws an exception saying that it
cannot be attached to more then one component. Should I file a bug or it is
expected behavior?

Vitaly

Re: Add/remove AbstractAjaxBehavior

Posted by Vitaly Tsaplin <vi...@gmail.com>.
I filed an issue https://issues.apache.org/jira/browse/WICKET-4925


2012/12/12 Vitaly Tsaplin <vi...@gmail.com>

> Hi Martin,
>
> Ok. But what if I want to remove it and then add again later? In my case
> I have several behaviors that are relatively heavy to create and I switch
> them.
>
> Vitaly
>
>
> 2012/12/12 Martin Grigorov <mg...@apache.org>
>
>> Hi,
>>
>> It is expected behavior.
>> An Ajax behavior can work with only one component because it cannot create
>> callbackUrl for more than one.
>>
>>
>> On Wed, Dec 12, 2012 at 4:06 PM, Vitaly Tsaplin <vitaly.tsaplin@gmail.com
>> >wrote:
>>
>> > Hi,
>> >
>> > It looks like it is not possible to remove an instance of
>> > AbstractAjaxBehavior. The behavior keeps reference to a component it was
>> > attached to and doesn't override unbind so it doesn't clear this
>> reference.
>> > On every subsequent attempt to attach it throws an exception saying
>> that it
>> > cannot be attached to more then one component. Should I file a bug or
>> it is
>> > expected behavior?
>> >
>> > Vitaly
>> >
>>
>>
>>
>> --
>> Martin Grigorov
>> jWeekend
>> Training, Consulting, Development
>> http://jWeekend.com <http://jweekend.com/>
>>
>
>

Re: Add/remove AbstractAjaxBehavior

Posted by Vitaly Tsaplin <vi...@gmail.com>.
Hi Martin,

Ok. But what if I want to remove it and then add again later? In my case I
have several behaviors that are relatively heavy to create and I switch
them.

Vitaly


2012/12/12 Martin Grigorov <mg...@apache.org>

> Hi,
>
> It is expected behavior.
> An Ajax behavior can work with only one component because it cannot create
> callbackUrl for more than one.
>
>
> On Wed, Dec 12, 2012 at 4:06 PM, Vitaly Tsaplin <vitaly.tsaplin@gmail.com
> >wrote:
>
> > Hi,
> >
> > It looks like it is not possible to remove an instance of
> > AbstractAjaxBehavior. The behavior keeps reference to a component it was
> > attached to and doesn't override unbind so it doesn't clear this
> reference.
> > On every subsequent attempt to attach it throws an exception saying that
> it
> > cannot be attached to more then one component. Should I file a bug or it
> is
> > expected behavior?
> >
> > Vitaly
> >
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com <http://jweekend.com/>
>

Re: Add/remove AbstractAjaxBehavior

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

It is expected behavior.
An Ajax behavior can work with only one component because it cannot create
callbackUrl for more than one.


On Wed, Dec 12, 2012 at 4:06 PM, Vitaly Tsaplin <vi...@gmail.com>wrote:

> Hi,
>
> It looks like it is not possible to remove an instance of
> AbstractAjaxBehavior. The behavior keeps reference to a component it was
> attached to and doesn't override unbind so it doesn't clear this reference.
> On every subsequent attempt to attach it throws an exception saying that it
> cannot be attached to more then one component. Should I file a bug or it is
> expected behavior?
>
> Vitaly
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>