Andreas Kappler created WICKET-5876:
---------------------------------------
Summary: 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
Priority: Minor
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)