Tuesday, November 2, 2010

Re: Driver Best Practices with CheckBox and RadioButtons

On 2 nov, 05:00, jefe <jeffrey.burn...@gmail.com> wrote:
> All,
>
> After reviewing the GWT 2.1 Editor/Driver features I've found uses
> fields like TextBox or DoubleBox but nothing pertaining to concepts
> such as CheckBox or RadioButton. Are there any specific best practices
> for providing binding between a bean and a group of radio buttons or a
> checkbox?
>
> Any insight would be appreciated.

A CheckBox is an IsEditor<LeafValueEditor<Boolean>> so you can use it
to edit boolean values the same as a TextBox for String values.

For more complex use cases (list of checkboxes to edit a list of
values, or a radio button group to edit a single value (insteaf of,
say, a ValueListBox)), you'd have to make your own editor.
For radio buttons, you might be able to use a ValuePicker passing a
CellList with a RadioButtonCell (you'd have to make your own Cell,
based on CheckBoxCell, or use CheckBoxCell if rendering as a checbox
rather than radio button doesn't bother you)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment