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

Maxim Solodovnik commented on WICKET-6516:
------------------------------------------

[~mgrigorov] As I understand additional cycles will be used for all components
And only auto-components will benefit of it
Does it worth so?

> wicket:for on a label placed after the input 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 on a label placed after the input, the id is not 
> automatically set on the related input, except if we force it by using 
> setOutputMarkupId(true).
> The attribute wicket:for by itself should force the id of the input to be 
> output, no matter if it is placed before or after the label, because like 
> that it's not consistent.
> Moreover, Bootstrap 4 custom checkboxes dictates us to put the label after 
> the input ( 
> https://getbootstrap.com/docs/4.0/components/forms/#checkboxes-and-radios-1 ).
> I feel that having to force the setOutputMarkupId(true) to the checkbox 
> everytime we use a checkbox isn't a clean solution.
> Example:
> {noformat}
> HTML:
> <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>
> Java:
> form.add( new CheckBox( "active" ) );
> Output HTML: the "for" on the label is there but the "id" on the input is 
> missing.
> <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>
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to