You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Virginie Garcin (JIRA)" <ji...@apache.org> on 2018/01/03 07:46:00 UTC

[jira] [Updated] (WICKET-6516) wicket:for inside a PropertyListView doesn't generate id on the input

     [ https://issues.apache.org/jira/browse/WICKET-6516?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Virginie Garcin updated WICKET-6516:
------------------------------------
    Description: 
When using wicket:for into a PropertyListView, the id is not automatically set on the related input, except if we force it by using setOutputMarkupId(true).
Outside a PropertyListView the id is generated without forcing it.
The attribute wicket:for by itself should force the id of the input to be output, no matter if it's in a list or not.

Example:

{noformat}
HTML:
<tr wicket:id="variations">
        <td>
                <div class="custom-control custom-checkbox">
                        <input wicket:id="active" type="checkbox" class="custom-control-input"/>
                        <label wicket:for="active" class="custom-control-label">Active</label>
                </div>
        </td>
</tr>

Java:
form.add( new PropertyListView<ProductVariation>( "variations" ) {
        @Override
        protected void populateItem(final ListItem<ProductVariation> variationItem) {
                variationItem.add( new CheckBox( "active" ) );
        }
} );

Output HTML: the "for" on the label is there but the "id" on the input is missing.
<tr>
        <td class="align-middle">
                <div class="custom-control custom-checkbox">
                        <input class="custom-control-input beingEdited pristine" checked="checked" name="variations:0:active" type="checkbox">
                        <label class="custom-control-label" id="activebb-w-lbl" for="activebb">Active</label>
                </div>
        </td>
</tr>
{noformat}



  was:
When using wicket:for into a PropertyListView, the id is not automatically set on the related input, except if we force it by using setOutputMarkupId(true).
Outside a PropertyListView the id is generated without forcing it.
The attribute wicket:for by itself should force the id of the input to be output, no matter if it's in a list or not.

Example:
{{
HTML:
<tr wicket:id="variations">
        <td>
                <div class="custom-control custom-checkbox">
                        <input wicket:id="active" type="checkbox" class="custom-control-input"/>
                        <label wicket:for="active" class="custom-control-label">Active</label>
                </div>
        </td>
</tr>

Java:
form.add( new PropertyListView<ProductVariation>( "variations" ) {
        @Override
        protected void populateItem(final ListItem<ProductVariation> variationItem) {
                variationItem.add( new CheckBox( "active" ) );
        }
} );

Output HTML: the "for" on the label is there but the "id" on the input is missing.
<tr>
        <td class="align-middle">
                <div class="custom-control custom-checkbox">
                        <input class="custom-control-input beingEdited pristine" checked="checked" name="variations:0:active" type="checkbox">
                        <label class="custom-control-label" id="activebb-w-lbl" for="activebb">Active</label>
                </div>
        </td>
</tr>
}}



> wicket:for inside a PropertyListView doesn't generate id on the input
> ---------------------------------------------------------------------
>
>                 Key: WICKET-6516
>                 URL: https://issues.apache.org/jira/browse/WICKET-6516
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 8.0.0-M8
>            Reporter: Virginie Garcin
>            Priority: Minor
>
> When using wicket:for into a PropertyListView, the id is not automatically set on the related input, except if we force it by using setOutputMarkupId(true).
> Outside a PropertyListView the id is generated without forcing it.
> The attribute wicket:for by itself should force the id of the input to be output, no matter if it's in a list or not.
> Example:
> {noformat}
> HTML:
> <tr wicket:id="variations">
>         <td>
>                 <div class="custom-control custom-checkbox">
>                         <input wicket:id="active" type="checkbox" class="custom-control-input"/>
>                         <label wicket:for="active" class="custom-control-label">Active</label>
>                 </div>
>         </td>
> </tr>
> Java:
> form.add( new PropertyListView<ProductVariation>( "variations" ) {
>         @Override
>         protected void populateItem(final ListItem<ProductVariation> variationItem) {
>                 variationItem.add( new CheckBox( "active" ) );
>         }
> } );
> Output HTML: the "for" on the label is there but the "id" on the input is missing.
> <tr>
>         <td class="align-middle">
>                 <div class="custom-control custom-checkbox">
>                         <input class="custom-control-input beingEdited pristine" checked="checked" name="variations:0:active" type="checkbox">
>                         <label class="custom-control-label" id="activebb-w-lbl" for="activebb">Active</label>
>                 </div>
>         </td>
> </tr>
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)