On Fri, Aug 9, 2013 at 4:41 PM, Oliver B. Fischer <mails...@swe-blog.net>wrote:
> Hi Martin, > > this is the markup I use: > > <div class="top-nav"> > <ul> > <li wicket:id="repeatme"> > <a href="#"> > The wicket:id is on <li>, so BookmarkablePageLink is attached to it. The <a> element has no wicket:id > <span wicket:id="label"></span> > </a> > </li> > </ul> > <div class="clearfix"></div> > </div> > > RepeatingView rv = new RepeatingView("repeatme"); for (Pair<? extends Class<? extends WebPage>, String> entry : menuEntries) { WebMarkupContainer li = new WebMarkupContainer(rv.**newChildId()); rv.add(li); BookmarkablePageLink link = new BookmarkablePageLink("link", entry.getLeft()); link.add(AttributeModifier.**append("class", "greenGradient", " ")); link.setModel(Model.of(entry.getRight()))); rv.add(link); } > > Am 09.08.13 13:54, schrieb Martin Grigorov: > >> Hi, >> >> It looks like your markup is not correct. >> Please paste it too. >> >> >> On Fri, Aug 9, 2013 at 2:48 PM, Oliver B. Fischer <mails...@swe-blog.net >> >wrote: >> >> Dear list, >>> >>> I have problems to add an attribute the <a> element generated by >>> BookmarkablePageLink. I use a RepeatingView to generate a unordered list. >>> The attribute I would like to add is not added to <a> element but to the >>> <li> element. The question is why? If I try the same code without a >>> repeating view the attribute is added the <a> element and not to the <li> >>> element. Does someone know why? >>> >>> Where is my code: >>> >>> RepeatingView rv = new RepeatingView("repeatme"); >>> >>> for (Pair<? extends Class<? extends WebPage>, String> entry : >>> menuEntries) >>> { >>> >>> Model<String> gradientModel = new Model<String>("greenGradient")****; >>> >>> BookmarkablePageLink link >>> = new BookmarkablePageLink(rv.****newChildId(), entry.getLeft()); >>> >>> link.add(AttributeModifier.****append("class", gradientModel)); >>> >>> >>> link.add(new Label("label", entry.getRight())); >>> >>> rv.add(link); >>> } >>> >>> Best, >>> >>> Oliver >>> >>> ------------------------------****----------------------------** >>> --**--------- >>> To unsubscribe, e-mail: >>> users-unsubscribe@wicket.**apa**che.org<http://apache.org> >>> <users-unsubscribe@**wicket.apache.org<users-unsubscr...@wicket.apache.org> >>> > >>> >>> For additional commands, e-mail: users-h...@wicket.apache.org >>> >>> >>> >> > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > users-unsubscribe@wicket.**apache.org<users-unsubscr...@wicket.apache.org> > For additional commands, e-mail: users-h...@wicket.apache.org > >