wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Grigorov <mgrigo...@apache.org>
Subject Re: ComponentNotFoundException when replace a fragment
Date Wed, 01 Aug 2012 14:14:57 GMT
Do you use -beta3 ?
There was a bug which is fixed in -SNAPSHOT. That's why I know how it works ;-)

On Wed, Aug 1, 2012 at 5:12 PM, Bertrand Guay-Paquet
<bernie@step.polymtl.ca> wrote:
> On 01/08/2012 9:58 AM, Martin Grigorov wrote:
>>
>>
>> No.
>> The timer is fired but the precondition prevents the Ajax call.
>> The precondition checks that the component (html element) on which is
>> attached the timer behavior is still in the DOM document.
>
> Hmm... I don't quite know what to say! In my tests, the timer is still fired
> event after its attached component is replaced.
>
> Here is the sequence of requests captured in Firebug:
>
> Ajax Request 1 (timer callback):
> http://localhost:8080/?2-1.IBehaviorListener.0-fragments&_=1343829988777
> <ajax-response>
> <evaluate>Wicket.timerHandle_fragments3 =
> setTimeout('Wicket.Ajax.ajax({\"u\":\"./.?2-1.IBehaviorListener.0-fragments\",\"c\":\"fragments3\"});',
> 2000)</evaluate>
> </ajax-response>
>
> Ajax Request 2 (click ajax link to replace the component "fragments"):
> http://localhost:8080/?2-1.IBehaviorListener.0-remove&_=1343829990235
> <ajax-response>
> <componentid="fragments3"><span wicket:id="fragments"
> id="fragments3">WMC</span></component>
> </ajax-response>
>
> Ajax Request 3 (timer callback):
> http://localhost:8080/?2-1.IBehaviorListener.0-fragments&_=1343829990803
> Throws exception:
> org.apache.wicket.behavior.InvalidBehaviorIdException: Cannot find behavior
> with id '0' on component
> 'org.apache.wicket.markup.html.WebMarkupContainer:fragments' in page '[Page
> class = com.mycompany.HomePage, id = 2, render count = 1]'. Perhaps the
> behavior did not properly implement getStatelessHint() and returned 'true'
> to indicate that it is stateless instead of returning 'false' to indicate
> that it is stateful.
>
> (this is a different exception than reported by Alex, but it looks like the
> same symptom)
>
> IMHO, the AjaxTimerBehavior should have been removed during the request #2
> since the replacement component does not have it attached.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message