Tobago Demo

Menu

AccessKey

The accessKey attribute is available for many components like buttons, checkboxes or links. A component with this attribute is accessible by the given character. The character is not case sensitive.

Logging the accessKey can be configured by setting the category org.apache.myfaces.tobago.internal.util.AccessKeyLogger to log level "debug".

The usage of accesskeys is different for every OS and browser.
For example, in the Windows-Firefox, you have to press 'Alt + Shift + key'. In Chrome for Mac OS X it's only 'Control + Alt + key'. A complete listing can be found at the Mozilla Developer Network.

Tag Library Documentation: <tc:button/> | <tc:checkbox/> | <tc:link/> | <tc:label/>

Basics

The accesskey is set to 'a'. Notice, that the 'A' in the label of the button has an underscore.

<tc:button label="Button AccessKey" accessKey="a">

Invisible Key

The accesskey is '3'. Nothing is underlinded, because the value of the label doesn't contain a '3'.

<tc:button label="Button Three" accessKey="3">

Input

The accessKey is also available for input fields. An input field will get the focus after pressing the accesskey.

In

<tc:in label="Input" accessKey="i"/>

Text Area

<tc:textarea label="Textarea" accessKey="t"/>

Label

For the <tc:label/> tag an accesskey can be set in combination with the for attribute.

The following example show a label which is automatically bound to the input field after that.

<tc:label value="Label" accessKey="l" for="@auto"/> <tc:in/>
© 2005-2023 Apache Software Foundation, Licensed under the Apache License, Version 2.0.