Wicket: Ajax callback onTimer() method not called
===

I use wicket 1.5 to develop a webapplication. I have three webpages, the homePage, the ParentWebpage and a Panel. When I setup an AbstractAjaxTimerBehavior in the ParentWebpage and call in the callback function onTimer() the Panel, every thing is alright.But in the panel is also an AbstractAjaxTimerBehavior and the callback function onTimer is never called, but why??

Here my example:

HomePage.java

    BookmarkablePageLink bookmarkablePageLink = new BookmarkablePageLink("linkToCurrentDiagnosePage", TestParent.class);
    bookmarkablePageLink.add("label");
    item.add(bookmarkablePageLink);

--> now I can navigate to the TestParent class

TestParent.java

    public class TestParent extends WebPage {
        /** The Constant logger. */
        private static final Logger LOGGER = Logger.getLogger(TestParent.class);
        boolean isSet = false;
        public TestParent() {
            LOGGER.error("Parent -> Cstr");
            Fragment fragment = new Fragment("fragments", "fragment1", TestParent.this);
            fragment.setOutputMarkupId(true);
            add(fragment);
            
            add(new AbstractAjaxTimerBehavior(Duration.seconds(1)) {
                
                @Override
                protected void onTimer(AjaxRequestTarget target) {
                    LOGGER.error("Parent -> I'am here");
                    if(isSet == false){
                        LOGGER.error("Parent -> I set the panel");
                        isSet = true;
                        Fragment fragment = new Fragment("fragments", "fragment2", TestParent.this);
                        fragment.setOutputMarkupId(true);
                        fragment.add(new TestChild("panel"));
                        TestParent.this.replace(fragment);
                        target.add(fragment);
                    }
                }
            });
        }
    }

TestParent.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    	<span wicket:id="fragments"></span>
    
    	<wicket:fragment wicket:id="fragment1">
    		FILL TEXT
    	</wicket:fragment>
    
    	<wicket:fragment wicket:id="fragment2">
    		<span wicket:id="panel">[message]</span>
    	</wicket:fragment>
    </body>
    </html>

TestChild.java

    public class TestChild extends Panel {
        private static final Logger LOGGER = Logger.getLogger(TestChild.class);
        
        public TestChild(String id) {
            super(id);
            LOGGER.error("Child -> Cstr");
            
            add(new AbstractAjaxTimerBehavior(Duration.seconds(1)) {
                
                @Override
                protected void onTimer(AjaxRequestTarget target) {
                    LOGGER.error("CHILD --> I'am here");
                }
            });               
        }
    }

TestChild.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    	<wicket:panel>
    	
    	</wicket:panel>
    </body>

</html>

OUTPUT:

    ERROR - TestParent                 - Parent -> Cstr
    
    ERROR - TestParent                 - Parent -> I'am here
    
    ERROR - TestParent                 - Parent -> I set the panel
    
    ERROR - TestChild                  - Child -> Cstr
    
    ERROR - TestParent                 - Parent -> I'am here
    
    ERROR - TestParent                 - Parent -> I'am here
    
    ERROR - TestParent                 - Parent -> I'am here
    
    ERROR - TestParent                 - Parent -> I'am here

