public static void connectFormControlWithLabel (@Nullable final IHCElement <?> aCtrl, @Nullable final HCFormLabel aLabel) {
if (aCtrl != null && aLabel != null)
{
// Set "for" in label
aLabel.setFor (aCtrl);
// Set "aria-labelledby"
aCtrl.customAttrs ().setAriaLabeledBy (aLabel);
} }
Wouldn't it be better if instead it uses the method addAriaLabeledBy? The difference would be that you could add ids before the connectFormControlWithLabel is called, at the moment that is not possible because the set overwrites the previously added ids.
The current method uses setAriaLabeledBy:
Wouldn't it be better if instead it uses the method addAriaLabeledBy? The difference would be that you could add ids before the connectFormControlWithLabel is called, at the moment that is not possible because the set overwrites the previously added ids.