It shouldn't be called as you described it.
Put a breakpoint in BasePage's constructor and see the thread stack.


On Fri, May 20, 2011 at 10:17 AM, Mathilde Pellerin <
[email protected]> wrote:

> Hi all,
>
> I am new in wicket and I encountering a problem with my Markup inheritance.
> In my BasePage (that extends WebPage), I have a menu with some
> BookmarkablePageLink :
> <ul class="blocklist">
>    <!-- MENU -->
>    <li wicket:id="accueilpage"><a>Accueil</a></li>
>    <li wicket:id="e4npage"><a>Infos E4N</a></li>
>    <li wicket:id="faqpage"><a>FAQ</a></li>
>    <li wicket:id="contactpage"><a>Contact</a></li>
>    <!-- END MENU -->
> </ul>
>
> and for each link I have a code like this in my BasePage constructor :
> final BookmarkablePageLink<Void> lienAccueil = new
> BookmarkablePageLink<Void>("accueilpage", AccueilPage.class);
> add(lienAccueil);
>
> It works well.
> But now, I want to add an attribute class to the menu selected. For
> example,
> in the AccueilPage constructor, I add that :
> WebMarkupContainer lienAccueil = new WebMarkupContainer("accueilpage");
> lienAccueil.add(new SimpleAttributeModifier("class", "selected-item"));
>
> but it doesn't work.
> I found that BasePage constructor is called before AND after my AccueilPage
> constructor. That's why the attribute class doesn't appear : it is added by
> AccueilPage but then, it remove by BasePage constructor I guess.
>
> So I wonder : why BasePage constructor is called after AccueilPage
> constructor? What am I doing wrong?
>
> Thanks
>
> Kind regards,
> Mathilde
>
> --
> *Mathilde Pellerin*
> Ingénieur en développement de logiciel
>
> STATLIFE
> tel : 01.42.11.64.88
> mail : [email protected]
>



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

Reply via email to