[ https://issues.apache.org/jira/browse/WICKET-5876?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Grigorov resolved WICKET-5876. ------------------------------------- Resolution: Not A Problem I also don't see how this could be improved. The form component is already rendered when the AutoLabel is resolved and it is too late to set its outputMarkupId(true) > wicket:for does not work if used after the referenced component > --------------------------------------------------------------- > > Key: WICKET-5876 > URL: https://issues.apache.org/jira/browse/WICKET-5876 > Project: Wicket > Issue Type: Bug > Components: wicket > Affects Versions: 6.19.0 > Reporter: Andreas Kappler > Assignee: Martin Grigorov > Priority: Minor > Attachments: myproject.tgz > > > This code works as expected ("for" attribute of <label> is set to id of > <input> and id of input is written to HTML): > <label wicket:for="cb">Label</label> <input type="checkbox" wicket:id="cb"/> > However if reversed, the id of the <input> is not written to the HTML and > therefore the <label> does not work properly: > <input type="checkbox" wicket:id="cb"/> <label wicket:for="cb">Label</label> > My guess is that the AutoLabelResolver calls the getMarkupId method of the > referenced FormComponent too late. A workaround is to call setOutputMarkupId > explictily on the FormComponent. -- This message was sent by Atlassian JIRA (v6.3.4#6332)