>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.

What bugs me too is that I can't place the text before the checkbox or in
another cell of a table. Maybe we should file a feature request if it
doesn't exist.

Fred

On Fri, Sep 12, 2008 at 21:08, Thomas Broyer <[EMAIL PROTECTED]> wrote:

>
>
> On 12 sep, 11:34, "Fred Janon" <[EMAIL PROTECTED]> wrote:
> > Creating a checkbox generates this code:
> >
> > <span class="gwt-CheckBox"><input id="gwt-uid-3" type="checkbox"
> tabindex="0
> > "/>
> > <label for="gwt-uid-3">arts</label>
> > </span>
> >
> > Is it possible to link a GWT Label to an input like a TextBox for
> example?
>
> The Label widget doesn't create a <label> element.
>
> > There is no label constructor like Label(InputWidget widget) (I made up
> the
> > InputWidget class name).
>
> No, there's no equivalent to a <label> element in GWT widgets; and
> yes, that's something I'm missing too, though I'm not sure how it
> would work: the "linked" widget must have an ID, and GWT doesn't
> generate IDs, except when calling ensureDebugId explicitly (when the
> Debug module is inherited), 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 on the
> linked widget or otherwise override the widget's ID after it has been
> "linked" to the FormLabel widget. A solution might be to override
> DebugIdImplEnabled to not overwrite existing IDs...
>
> > I think screen readers need that.
>
> I guess AT (not only screen readers) support the labelledby ARIA role,
> that might be "easier" to use/implement, in the sense that GWT
> wouldn't do anything more than now: generate an ID (could be a call to
> ensureDebugId) for the widget you'd like to use as a label (Label,
> InlineLabel, HTML, InlineHTML; or even use the ID of an element
> already present on the host page) and call
> Accessibility.setState(myTextBox.getElement(), "aria-labelledby",
> theLabelID).
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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