The easiest way is probably to use a wicket:for attribute: <label wicket:for="enabledCheck">Enabled</label> <input type="checkbox" wicket:id="enabledCheck"/>
Alternatively, you can also use FormComponent#setLabel(IModel<String>) in Java to define an input's label value, then show that label by adding (Simple)FormComponentLabel as a separate component (i.e. with its own wicket:id). On Sat, Jun 30, 2012 at 9:13 AM, Dan12321 <wee...@centrum.cz> wrote: > Hi, > when I click on text in element, it select or unselect checkbox. But I > need > to set attribute "for" in label and attribute "id" in checkbox input. > I use it in repeater. So I have to generate random text for this > attributes. > Is there any better way how to do it? > > -- > View this message in context: > http://apache-wicket.1842946.n4.nabble.com/how-to-connect-elements-label-and-input-checkbox-tp4650304p4650308.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 > >