You need to use org.apache.wicket.markup.html.form.FormComponentLabel for the <label>s or formComponent.setMarkupId("somethingStable") which is not recomended
On Thu, Nov 4, 2010 at 1:52 PM, Benjamin Lorenz < benjamin.lor...@kapowtech.com> wrote: > Hello, > > in the following code, the id of the radio input is changed by wicket, so > that it does not match the "for" attribute of the corresponding label > anymore. > > How can I make sure that this does not happen? > > Thanks, > Benjamin > > > <wicket:panel> > <wicket:container wicket:id="docchoice"> > <tr class="odd"> > <th colspan="4">Verkaufsunterlagen</th> > </tr> > <tr class="odd"> > <td> > <input type="radio" name="brochure" id="brochureNo" value="0" > wicket:id="0"/> > </td> > <td colspan="3"> > <label for="brochureNo">Ich verzichte auf die gesetzlichen > Verkaufsunterlagen</label> > </td> > </tr> > <tr class="odd"> > <td> > <input type="radio" name="brochure" id="brochureYes" value="1" > wicket:id="1"/> > </td> > <td colspan="3"> > <label for="brochureYes">Ich möchte die gesetzlichen > Verkaufsunterlagen einsehen</label> > </td> > </tr> > </wicket:container> > </wicket:panel> > > > public class OrderInputEnrichedDocumentsPanel extends Panel { > > public OrderInputEnrichedDocumentsPanel(String id, Form verifyForm) { > super(id); > RadioGroup docChoice = new RadioGroup("docchoice"); > docChoice.add(new Radio<OrderSecondQuery.Choice>("0", > new Model<OrderSecondQuery.Choice>(OrderSecondQuery.Choice.NO > ))); > docChoice.add(new Radio<OrderSecondQuery.Choice>("1", > new > Model<OrderSecondQuery.Choice>(OrderSecondQuery.Choice.YES))); > verifyForm.add(docChoice); > add(docChoice); > } > } > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >