What I am trying to do is: 

if menu item is selected (onClick), change the markup <li> id or class. 

However, it doesn't seem to work. Am I missing something? 


<ul id="menu">
<li class="menuitem" wicket:id="menuitem">


ListView listView = new ListView( "menuitem", menuItemList ) {                  
protected void populateItem( ListItem<MenuItem> item ) {
        final MenuItem menuItem = item.getModelObject();
        Link<WebPage> link = new Link<WebPage>( "menuitemLink" ) {
                public void onClick() {
                        MarkupContainer container = getParent();
                        //System.out.println( "container: "+container );
                        container.setMarkupId( "selected_menu_item" );
                        //System.out.println( "container: 
"+container.getMarkupId() );
                        container.add( new SimpleAttributeModifier( "id", 
"selected_menu_item" )
                        setResponsePage( menuItem.getPage() );
        link.add( new Label( "menuitemName", menuItem.getId() ) );
        item.add( link );


Any help is much appreciated.  

View this message in context: 
Sent from the Users forum mailing list archive at Nabble.com.

To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to