I also got it to work by using a <wicket:container> and a WebMarkupContainer
HTML <wicket:container wicket:id="dataview"> <div wicket:id="wmc" id="dynamic"> <span wicket:id="myLabel" /> </div> </wicket:container> JAVA new DataView<POJO>("dataview", dataProvider) { protected void populateItem(Item<POJO> item) { WebMarkupContainer wmc = new WebMarkupContainer("wmc") { protected void onComponentTag(ComponentTag tag) { super.onComponentTag(tag); tag.put("id", "dynamicValue"); } }; item.add(wmc); wmc.add(new Label("myLabel", item.getModelObject().getValue())); } } Is one way "better" than the other? On Thu, Dec 16, 2010 at 6:51 PM, Martijn Dashorst < martijn.dasho...@gmail.com> wrote: > item.add(new AttributeModifier("attr", true, "value")); > > dataview#oncomponenttag doesn't do anything since the dataview repeats > its markup with a listitem. the list item#oncomponenttag actually > receives the markup tag. > > Martijn > > On Thu, Dec 16, 2010 at 10:04 PM, Matt Schmidt <mschmid...@gmail.com> > wrote: > > I'm trying to modify an attribute on the HTML element that goes with my > > DataView: > > > > HTML > > <div wicket:id="dataview" id="dynamic"> > > <span wicket:id="myLabel" /> > > </div> > > > > JAVA > > new DataView<POJO>("dataview", dataProvider) { > > protected void populateItem(Item<POJO> item) { > > item.add(new Label("myLabel", item.getModelObject().getValue())); > > } > > protected void onComponentTag(ComponentTag tag) { > > super.onComponentTag(tag); > > tag.put("id", "dynamicValue"); > > } > > } > > > > I thought this would do it, but I never even hit > DataView.onComponentTag(). > > Any other suggestions? > > > > -Matt > > > > > > -- > Become a Wicket expert, learn from the best: http://wicketinaction.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >