Martijn Dashorst wrote:
It doesn't work until after adding the component to the page.

This is true.

So you need something like this (I've modified your variable names to make it more obvious what is what):

pageLink.add(new AttributeModifier("class", true,
        new AbstractReadOnlyModel() {
            public Object getObject() {
                return
                    getPage().getClass().equals(menuItem.getPageClass())
                    ? "activeMenuItem"
                    : AttributeModifier.VALUELESS_ATTRIBUTE_REMOVE;
            }
        }
);

Probably. ;-)

Regards,

Al

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

Reply via email to