You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Carl-Eric Menzel (JIRA)" <ji...@apache.org> on 2011/07/13 15:40:59 UTC

[jira] [Commented] (WICKET-3894) AutoLabelResolver breaks when the label contains wicket:message or a nested component

    [ https://issues.apache.org/jira/browse/WICKET-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13064546#comment-13064546 ] 

Carl-Eric Menzel commented on WICKET-3894:
------------------------------------------

The use case for just having a <wicket:message> inside the AutoLabel is that I don't have a label model on the form component, I just want the <label> to be automatically marked for the <input>.

> AutoLabelResolver breaks when the label contains wicket:message or a nested component
> -------------------------------------------------------------------------------------
>
>                 Key: WICKET-3894
>                 URL: https://issues.apache.org/jira/browse/WICKET-3894
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.4.18, 1.5-RC6
>            Reporter: Carl-Eric Menzel
>         Attachments: 1.4-0001-make-autolabelresolver-compatible-with-nested-compon.patch, 1.5-0001-make-autolabelresolver-compatible-with-nested-compon.patch
>
>
> AutoLabelResolver is very useful for us, but I've discovered two related problems.
> Nesting a wicket:message doesn't work.
> <label wicket:for="..."><wicket:message key="foo">bar</wicket:message></label>
> In this case I get a MarkupException, claiming that it's missing the closing tag for <label>, even though it's there. This is fixed by removing the guard that checks for RawMarkup at AutoLabel#onComponentTag. It does not seem to be breaking anything else. The cast to RawMarkup further down was a complete no-op, so it could be safely removed.
> Also, nesting an input component in its label does not work either:
> <label wicket:for="myComp"><input type="text" wicket:id="myComp"/></label>
> Here it complains about being unable to find the input component. This is fixed by making AutoLabelResolver transparent in 1.4, and by making AutoLabel into a TransparentWebMarkupContainer in 1.5.
> Patches are ready.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira