WebARIA
Namespace: Wisej.Web.Ext.WebARIA
Assembly: Wisej.Web.Ext.WebARIA (4.1.0.0)
Extender component that adds the ARIA (WAI-ARIA) property to all controls in the same container, allowing the application to assign aria-* attributes to the accessibility element of each control.
- C#
- VB.NET
public class WebARIA : Component, IExtenderProvider
Public Class WebARIA
Inherits Component
Implements IExtenderProvider
Drop the component on a container (i.e. a Form or Page) and use the "Aria" property added to each control in the designer, or call GetAria in code. The attributes are applied on the client to the control's accessibility element. Controls that are not created yet (i.e. not visible) are registered when they are created.
Constructors
WebARIA()
Initializes a new instance of the WebARIA extender without a specified container.
WebARIA(container)
Initializes a new instance of the WebARIA extender with a specified container.
| Name | Type | Description |
|---|---|---|
| container | IContainer | An IContainer that represents the container of the WebARIA extender. |
Throws:
- ArgumentNullException container is null.
Methods
CanExtend(target)
Returns true if WebARIA can offer an extender property to the specified target component.
| Parameter | Type | Description |
|---|---|---|
| target | Object | The target object to add an extender property to. |
Returns: Boolean. true if target is a Control; otherwise, false.
This method is used by the designer to determine which components receive the "Aria" property.
Example:
Checking whether a component can receive ARIA attributes:
if (this.webARIA1.CanExtend(this.textBox1))
{
this.webARIA1.GetAria(this.textBox1).Label = "Customer name";
}
Clear()
Removes the ARIA properties from all the controls managed by this extender.
The aria-* attributes previously assigned on the client are removed.
Example:
Removing all the ARIA attributes:
private void buttonReset_Click(object sender, EventArgs e)
{
this.webARIA1.Clear();
}
Dispose(disposing)
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean |
GetAria(control)
Returns the ARIA properties for the specified Control.
Returns: ARIA. The ARIA instance associated with control . It's created the first time it's requested.
The returned object is kept by the extender until the control is disposed or Clear is called. The attributes are sent to the client when the extender is rendered. Changing the ARIA properties invalidates the owner control; call Update() on the extender to refresh the attributes of controls that are already displayed.
Throws:
- ArgumentNullException control is null.
Example:
Assigning ARIA attributes to a text box and a numeric field:
private void Form1_Load(object sender, EventArgs e)
{
var aria = this.webARIA1.GetAria(this.textBoxEmail);
aria.Label = "Email address";
aria.Required = TriState.True;
aria.DescribedBy = this.labelEmailHint;
var quantity = this.webARIA1.GetAria(this.numericUpDownQuantity);
quantity.ValueMin = 1;
quantity.ValueMax = 100;
quantity.ValueNow = 10;
this.webARIA1.Update();
}
OnWebRender(config)
Renders the client component.
| Parameter | Type | Description |
|---|---|---|
| config | Object | Dynamic configuration object. |
Implements
| Name | Description |
|---|---|
| IUserData | |
| IWisejComponent | |
| IWisejSerializable |