bgooren commented on issue #1632:
URL: https://github.com/apache/wicket/issues/1632#issuecomment-5929715205

   I understand that an HTML `for` attribute cannot meaningfully target a 
body-only component such as `CheckGroup`.
   
   My use case is a reusable form-field wrapper that renders a label, help 
text, and layout markup around an arbitrary `FormComponent`. Its markup uses 
`wicket:for`, so it benefits from automatic label text and 
required/error/disabled classes.
   
   Since `CheckGroup` is itself a standard `FormComponent`, passing one to that 
wrapper currently produces warnings. The wrapper cannot decide in its static 
markup whether the supplied component renders its own tag.
   
   Using `wicket:id` instead means managing the label in Java and reproducing 
the conditional association and form-state behavior in application code.
   
   The proposed fix moves that decision into Wicket: retain the HTML `for` 
association where supported, and omit it for body-only targets while preserving 
the other auto-label functionality. It does not attempt to make clicking a 
group label focus an input.
   
   Would supporting this reusable-component use case make sense?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to