this.client = client;
owner = component;
- AriaHelper.bindCaption(component.getWidget(), getElement());
-
if (client != null && owner != null) {
setOwnerPid(getElement(), owner.getConnectorId());
}
setStyleName(CLASSNAME);
}
+ @Override
+ protected void onAttach() {
+ super.onAttach();
+
+ if (null != owner) {
+ AriaHelper.bindCaption(owner.getWidget(), getElement());
+ }
+ }
+
+ @Override
+ protected void onDetach() {
+ super.onDetach();
+
+ if (null != owner) {
+ AriaHelper.bindCaption(owner.getWidget(), null);
+ }
+ }
+
/**
* Updates the caption from UIDL.
*
import com.vaadin.client.Util;
import com.vaadin.client.VConsole;
import com.vaadin.client.ui.aria.AriaHelper;
+import com.vaadin.client.ui.aria.HandlesAriaCaption;
import com.vaadin.client.ui.aria.HandlesAriaInvalid;
import com.vaadin.client.ui.aria.HandlesAriaRequired;
import com.vaadin.client.ui.menubar.MenuBar;
@SuppressWarnings("deprecation")
public class VFilterSelect extends Composite implements Field, KeyDownHandler,
KeyUpHandler, ClickHandler, FocusHandler, BlurHandler, Focusable,
- SubPartAware, HandlesAriaInvalid, HandlesAriaRequired {
+ SubPartAware, HandlesAriaCaption, HandlesAriaInvalid,
+ HandlesAriaRequired {
/**
* Represents a suggestion in the suggestion popup box
tb.addBlurHandler(this);
tb.addClickHandler(this);
- Roles.getTextboxRole().set(tb.getElement());
-
popupOpener.addClickHandler(this);
setStyleName(CLASSNAME);
public void setAriaInvalid(boolean invalid) {
AriaHelper.handleInputInvalid(tb, invalid);
}
+
+ @Override
+ public void bindAriaCaption(Element captionElement) {
+ AriaHelper.bindCaption(tb, captionElement);
+ }
}
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.PopupPanel.PositionCallback;
+import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.BrowserInfo;
import com.vaadin.client.VConsole;
descriptionForAssisitveDevicesElement
.setInnerText(PopupDateFieldState.DESCRIPTION_FOR_ASSISTIVE_DEVICES);
AriaHelper.ensureHasId(descriptionForAssisitveDevicesElement);
- Id.of(descriptionForAssisitveDevicesElement);
+ Roles.getTextboxRole().setAriaDescribedbyProperty(text.getElement(),
+ Id.of(descriptionForAssisitveDevicesElement));
AriaHelper.setVisibleForAssistiveDevicesOnly(
descriptionForAssisitveDevicesElement, true);
- DOM.appendChild(getElement(), descriptionForAssisitveDevicesElement);
calendar = GWT.create(VCalendarPanel.class);
calendar.setParentField(this);
}
});
+ // FIXME: Problem is, that the element with the provided id does not
+ // exist yet in html. This is the same problem as with the context menu.
+ // Apply here the same fix (#11795)
+ Roles.getTextboxRole().setAriaControlsProperty(text.getElement(),
+ Id.of(calendar.getElement()));
Roles.getButtonRole().setAriaControlsProperty(
calendarToggle.getElement(), Id.of(calendar.getElement()));
updateStyleNames();
}
+ @Override
+ protected void onAttach() {
+ super.onAttach();
+ DOM.appendChild(RootPanel.get().getElement(),
+ descriptionForAssisitveDevicesElement);
+ }
+
+ @Override
+ protected void onDetach() {
+ super.onDetach();
+ descriptionForAssisitveDevicesElement.removeFromParent();
+ }
+
@SuppressWarnings("deprecation")
public void updateValue(Date newDate) {
Date currentDate = getCurrentDate();
package com.vaadin.client.ui;
-import com.google.gwt.aria.client.Roles;
import com.google.gwt.event.dom.client.BlurEvent;
import com.google.gwt.event.dom.client.BlurHandler;
import com.google.gwt.event.dom.client.ChangeEvent;
}
addFocusHandler(this);
addBlurHandler(this);
-
- // Add a11y role "textbox"
- Roles.getTextboxRole().set(node);
}
/**
}
});
- Roles.getTextboxRole().set(text.getElement());
-
add(text);
}