Thanks alot. It worked now. inspired by suckerFishPanel this is what I came
up with

class NavigationMenuItem{
                
                
                public static final String LINK_ID = "link";
                private final AbstractLink link;
                private final Label label;
                public static final String LINK_TEXT_ID = "linktext";
                
                
                public NavigationMenuItem(final AbstractLink link, final String 
strLabel,
boolean active)
                {
                        if (link != null && !link.getId().equals(LINK_ID))
                        {
                                throw new IllegalArgumentException(
                                                "The id must be 
NavigationMenuItem.LINK_ID");
                        }
                        this.link = link;
                        this.label = new Label(LINK_TEXT_ID, strLabel);
                        if( active )
                        this.link.add(new AttributeModifier("class", true, new 
Model(
"navigationLinkSelected" )));
                        this.link.add(this.label);
                }
                
                public NavigationMenuItem(final AbstractLink link, final String 
strLabel)
                {
                        this( link , strLabel, false );
                }
                
                public Label getLabel(){
                        return this.label;
                }
                
                public AbstractLink getLink(){
                        return this.link;
                }
        }


My problem here is the active flag. If a link is active I want to set
background etc. But I really against setting a hard coded attribute in code.
Is this really the way of doing this.
-- 
View this message in context: 
http://www.nabble.com/problem-with-menu-tp16700154p16720986.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to