Another disadvantage:  code that merely needs to get at the
label (which is, for instance, used to build up the FacesMessage
in the JSF 1.2 spec) needs to know about this and strip out any
underscores, which is painful and not necessarily possible.

The way we handle this in ADF Faces is that our labelAndAccessKey
is a virtual attr that automatically splits in two and writes out to
label and accessKey.  So, your JSPs usually deal in
labelAndAccessKey, and your Renderers and Component code
deals exclusively in label and accessKey separately.

FWIW, the standard convention for this - which dates way back to
Windows programming - was to use an ampersand, not
an underscore.  I can see why underscore would be more
appealing these days.

-- Adam Winer


On 10/12/05, Udo Schnurpfeil <[EMAIL PROTECTED] > wrote:
Hi!

At the moment we have 3 attributes regarding labels and accesskeys:
   1. label
   2. accessKey
   3. labelWithAccessKey
But I don't think that is reasonable. There is a dependency between
"label" and "accessKey": the accessKey must appear in the label.
(In the short form "labelWithAccessKey" the accesskey is marked by a
prefixed underscore.)
So only the labelWithAccessKey is really needed.
We should remove "accessKey" and "labelWithAccessKey" and put the
"labelWithAccessKey"-funktionallity inside of the "label" if there is a
underscore "_" inside.

Advantage:
*  2 attributes less.
*  No JSP changes needed to introduce an accesskey (only the e.g.
    properties have to be changed)

Disadvantage:
*  Real underscores "_" must be quoted e.g. by a backslash "\".

We have a discussion about internationalization to keep the same
accessKey in different languages. But this is rather unusual.
Therefore we need acellerator keys (<ctrl>+<x>) in further versions.

Any suggestions?

Udo

Reply via email to