It somehow feels bad/wrong to move CSS from WicketHTML to JavaCode, where it shouldn't belong, for such a common scenario. It defeats the purpose of having HTML in Wicket. But there probably is no other way.
Anyway, thanks for your reply :) > ----- Original Message ----- > > From: Fatih Mehmet UCAR > Sent: 08/21/10 03:43 PM > To: users@wicket.apache.org > Subject: Re: setRenderBodyOnly with ListView and attributes > > AttributeAppender class will help you to acheive that. > > -fmu > > ----- Original Message ----- > From: "J" <bluecar...@gmx.com> > To: <users@wicket.apache.org> > Sent: Saturday, August 21, 2010 2:24 PM > Subject: setRenderBodyOnly with ListView and attributes > > > > hi, I want to have Wicket to generate the following HTML precisely: > > > > <div class="products"> > > <div class="product">.....</div> > > <div class="product">.....</div> > > <div class="product">.....</div> > > <div class="product">.....</div> > > </div> > > > > But with my code, I don't get further than: > > > > <div> > > <div class="product">.....</div> > > <div class="product">.....</div> > > <div class="product">.....</div> > > <div class="product">.....</div> > > </div> > > > > so the class attribute is missing in the outer div. > > > > My Wicket HTML is: > > <div class="products" wicket:id="productsView"> > > <div class="product" wicket:id="productPanel">.....</div> > > </div> > > > > > > My code: > > ListView productsView = new ListView("productsView", products) { > > protected void populateItem(ListItem item) { > > item.setRenderBodyOnly(true); > > item.add(new ProductPanel("productPanel", item.getModelObject())); > > } > > }; > > add(productsView); > > > > > > What is the Wicket way of achieving this? > > (A solution is to use the wicket:container tag, but that's a bit ugly, > > right?) > > > > --------------------------------------------------------------------- > > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org