You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Andreas Kappler (JIRA)" <ji...@apache.org> on 2015/04/09 16:41:12 UTC
[jira] [Commented] (WICKET-5876) wicket:for does not work if used
after the referenced component
[ https://issues.apache.org/jira/browse/WICKET-5876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14487432#comment-14487432 ]
Andreas Kappler commented on WICKET-5876:
-----------------------------------------
I just saw that wicket issues a warning in this case. I also do not see how the behavior could be improved.
Please close the ticket, sorry!
> 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
> 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)