Directory

← Back

Attributes

Extension to add DOM Attributes to Components

Author

Contributors

Rating

Extending any Component with this Extension allows you to set an attribute to the client side Widget from the server side.

This can be very handy to provide WAI-ARIA attributes for the Components.

Sample code

TextField textField = new TextField();
textField.setId( FIELD_ID);

Label label = new Label( "First Name:");

Attribute labelFor = new Attribute( "for", FIELD_ID);
labelFor.extend( label);
Label separateComboLabel = new Label( "Separate Caption");
layout.addComponent( separateComboLabel);

ComboBox noLabelCombo = new ComboBox();
layout.addComponent( noLabelCombo);

CaptionAttribute comboLabeled = new CaptionAttribute( separateComboLabel);
comboLabeled.extend( noLabelCombo);

Compatibility

(Loading compatibility data...)

Was this helpful? Need more help?
Leave a comment or a question below. You can also join the chat on Discord or ask questions on StackOverflow.

Version

Allows now to bind captions to components in such a way, that a screen reader finds the caption for an input field.

Released
2013-09-01
Maturity
EXPERIMENTAL
License
Apache License 2.0

Compatibility

Framework
Vaadin 7.1+
Vaadin 7.0+ in 0.0.3
Browser
Internet Explorer
Firefox
Opera
Safari
Google Chrome
Internet Explorer
Online