You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Thomas Hammerl (JIRA)" <ji...@apache.org> on 2011/04/22 11:43:05 UTC

[jira] [Issue Comment Edited] (WICKET-3128) FormComponentLabel should open open-close tags like Label does

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

Thomas Hammerl edited comment on WICKET-3128 at 4/22/11 9:42 AM:
-----------------------------------------------------------------

I suppose that this change might have introduced a bug. I'm trying to create the following component hierarchy using Wicket 1.4.16:

InterestPanel.html
<label wicket:id="interestLabel">
  <input wicket:id="interestCheckbox" class="interest" type="checkbox"/>
  <div wicket:id="labelImage">label image</div>
  <span wicket:id="labelText">label text</span>
</label>

InterestPanel.java
CheckBox checkBox = new CheckBox("interestCheckbox", model);
FormComponentLabel interestLabel = new FormComponentLabel("interestLabel", checkBox);
interestLabel.add(new InterestTypeImage("interestImage", interestType));
interestLabel.add(checkBox);
interestLabel.add(new Label("interestText", "some text"));
add(interestLabel);

This surprisingly results in the following html output:

<label>
  <input type="checkbox">
</label>
<div>...</div>
<span>some text</span>

      was (Author: thomas.hammerl):
    I suppose that this change might have introduced a bug. I'm trying to create the following component hierarchy using Wicket 1.4.16:

InterestPanel.html
<label wicket:id="interestLabel">
  <input wicket:id="interestCheckbox" class="interest" type="checkbox"/>
  <div wicket:id="labelImage">label image</div>
  <span wicket:id="labelText">label text</span>
</label>

InterestPanel.java
CheckBox checkBox = new CheckBox("interestCheckbox", model);
FormComponentLabel interestLabel = new FormComponentLabel("interestLabel", checkBox);
interestLabel.add(new InterestTypeImage("interestImage", interestType));
interestLabel.add(checkBox);
add(interestLabel);

This surprisingly results in the following html output:

<label>
  <input type="checkbox">
</label>
<div>label image</div>
<span>label text</span>
  
> FormComponentLabel should open open-close tags like Label does
> --------------------------------------------------------------
>
>                 Key: WICKET-3128
>                 URL: https://issues.apache.org/jira/browse/WICKET-3128
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-core
>    Affects Versions: 1.4.12, 1.5-M2.1
>            Reporter: Joonas Koivunen
>            Assignee: Jeremy Thomerson
>            Priority: Minor
>             Fix For: 1.4.13, 1.5-M3
>
>         Attachments: wicket-3128.patch
>
>
> Seems to affect all versions.
> FormComponentLabel nor it's subclass SimpleFormComponentLabel open the tag like Label does.
> While writing <label wicket:id="xyz"/> is invalid XHTML I'd argue this should be supported as Label will expand tags as well.
> FormComponentLabel asserts that the tags name is "label", so that's the reasoning behind implementing it there (in the patch attached).
> Patch is trivial and identical for both 1.4 and 1.5 branches.

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