Are you sure that message is coming from this code? This code looks quite alright to me (though you could replace StringResourceModel(x, this, null) with ResourceModel(x), and change the parameter type to IModel<String>).

Regards,
   Erik.


Azzeddine Daddah wrote:
Thanks Michael,

I did but the warnings are still displayed.

private void addLinks() {
        addLink("home", new StringResourceModel("navigationbar.menu.home",
this, null), HomePage.class);
        addLink("numberPool", new
StringResourceModel("navigationbar.menu.numberpool", this, null),
NumberPoolPage.class);
        addLink("numberPoolLog", new
StringResourceModel("navigationbar.menu.numberpoollog", this, null),
NumberPoolLogPage.class);
        addLink("defragment", new
StringResourceModel("navigationbar.menu.defragment", this, null),
DefragmentPage.class);
        addLink("search", new
StringResourceModel("navigationbar.menu.search", this, null),
SearchPage.class);
    }

    private void addLink(String id, StringResourceModel model, final Class<?
extends Page> pageClass) {
        BookmarkablePageLink link = new BookmarkablePageLink(id, pageClass);
        link.add(new AttributeModifier("class", true, new
AbstractReadOnlyModel() {
            private static final long serialVersionUID = 1L;

            @Override
            public Object getObject() {
                String currentPageName = pageClass.getName();
                String parentPageName  = getPage().getClass().getName();
                return StringUtils.equals(currentPageName, parentPageName) ?
"current_page_item" : AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
            }

        }));
        link.add(new Label("title", model));
        add(link);
    }

Gr. Azzeddine



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to