listview.setreuseitems(true) for what its worth it is better to pull then to push values.
-igor On Sat, Oct 16, 2010 at 11:10 PM, always_rick <sh...@hotmail.com> wrote: > > 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? > > html > > <ul id="menu"> > <li class="menuitem" wicket:id="menuitem"> > # > </li> > </ul> > > > wicket > > ListView listView = new ListView( "menuitem", menuItemList ) { > @Override > protected void populateItem( ListItem<MenuItem> item ) { > final MenuItem menuItem = item.getModelObject(); > > Link<WebPage> link = new Link<WebPage>( "menuitemLink" ) { > �...@override > 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: > http://apache-wicket.1842946.n4.nabble.com/Link-onclick-setMarkupId-doesn-t-work-tp2998815p2998815.html > 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 > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org