On 12 sep, 15:16, "Fred Janon" <[EMAIL PROTECTED]> wrote:
> >this means that the FormLabel widget would
> >have to generate an ID for the linked widget –not a big deal– but also
> >that you have to ensure that you do not call ensureDebugId
>
> I am not sure my original message was explicit enough, but the HTML code:
>
> <span class="gwt-CheckBox"><input id="gwt-uid-3" type="checkbox"
> tabindex="0"/>
> <label for="gwt-uid-3">arts</label>
> </span>
>
> was generated by GWT:
>
> CheckBox cb = new CheckBox("arts");
>
> so GWT does it already for an input type='checkbox', it could do it for any
> element that 'label' can attach to.

..no, because CheckBox is a single widget, composed of a check box and
label (if you want a simple check box, use SimpleCheckBox): the label
is a component of the widget that you cannot manipulate directly.
ensureDebugId on CheckBox doesn't erase the generated ID of the check
box (that is used to "link" it to the label), because the CheckBox's
"element" is the <span>, and it *controls* what's in it.

> What bugs me too is that I can't place the text before the checkbox or in
> another cell of a table.

For the very same reason: it's "by design".

...I was "brainstorming" an implementation design and ended up with a
workaround: generate the ID by yourself and use it with the
Accessibility class to assign aria-labelled for AT.

(Note that this doesn't replace –I haven't tested, just guessing– the
<label> behavior: when you click the label, you focus or activate the
"linked" element, but it wasn't really what you were asking for ;-) )

> Maybe we should file a feature request if it doesn't exist.

If you know for sure that you won't call ensureDebugIdon the "linked"
widget or change its ID afterwards, you can safely create a FormLabel
widget; but including such a widget in GWT is likely to cause problems
to people using ensureDebugId (at least how it's done now, overwriting
any already set ID).

...maybe Ext-GWT (GXT) or GWT-Ext have such a widget too...

(as a workaround, you can also use a ClickListener on a Label, of
course)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to