I have found that using InnerLabel with InnerHTML and a TextBox, I can come
close to making it cleaner HTML than the overhead of a table just to put a
label and input field together, with something like:
FlowPanel nameAndLabel = new FlowPanel();
InlineLabel label = new InlineLabel("Name");
TextBox nameField = new TextBox();
nameField.setValue("Bob");
nameAndLabel.add(label);
nameAndLabel.add( new InlineHTML("<br/>") );
nameAndLabel.add(nameField);
But the Label class doesn't actually generate a <label> tag, so the label is
not also associated with the TextBox for accessibility (it's just a span).
The idea of having labeled input fields is so basic, that there must be a
nicer solution. I noted that RadioButton does a good job of associating the
label with the radio button itself.
Is there something comparable in GWT 2 to make the label/TextBox (or other
input widgets) go together to produce simple HTML like:
<label>Name<br/><input ></label>
Thanks for any tips....
--
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.