Discussion:
RadioCell?
BrianV
2010-11-17 16:46:50 UTC
Permalink
I was hoping to put a list of radio buttons in a CellTable column but
didn't see the equivalent RadioCell class. I'm prototyping with a
SelectCell, but it really calls for a few radio buttons in a group.
What's the best magic incantation to coerce GWT's CellTable/Cell
Columns to rendering a group of radio buttons?
--
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-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
zixzigma
2010-11-17 22:32:22 UTC
Permalink
i was also curious to know if there is a Checkbox Cell ?
--
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-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
John LaBanca
2010-11-17 22:38:43 UTC
Permalink
There is a CheckboxCell but there is not a RadioCell. I think BrianV was
looking for a RadioGroupCell that would show multiple radio buttons in a
single cell, but that isn't implemented.

Thanks,
John LaBanca
Post by zixzigma
i was also curious to know if there is a Checkbox Cell ?
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To unsubscribe from this group, send email to
.
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.
--
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-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
BrianV
2010-11-17 22:44:15 UTC
Permalink
There is - see CheckboxCell. It works fine, but it is not a collection
of radio buttons.

I did look at the GWT source for several other "Cell" objects and it
looks straightforward to create a custom "RadioCell" that implements a
single Radio button (using the CheckboxCell as a roadmap for how this
is done). However, what would be the best way to cram 3 or 4 of them
in a Cell? Is the CompositeCell the right mechanism for this? Is there
anything special that my custom "RadioCell" would need to do to be a
member of a "CompositeCell"?
Post by zixzigma
i was also curious to know if there is a Checkbox Cell ?
--
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-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Thomas Broyer
2010-11-18 00:22:12 UTC
Permalink
Post by BrianV
There is - see CheckboxCell. It works fine, but it is not a collection
of radio buttons.
I did look at the GWT source for several other "Cell" objects and it
looks straightforward to create a custom "RadioCell" that implements a
single Radio button (using the CheckboxCell as a roadmap for how this
is done). However, what would be the best way to cram 3 or 4 of them
in a Cell? Is the CompositeCell the right mechanism for this? Is there
anything special that my custom "RadioCell" would need to do to be a
member of a "CompositeCell"?
I wouldn't use a CompositeCell (CompositeCell is more about the same
as a CellTable row but without the column-based layout).
The thing you'd have to take care of would be entering/exiting "edit
mode" (isEditing()) and focus management (i.e. resetFocus). It's easy
with the built-in cells as they only have a single focusable element
(check box, text box, select) but I suppose it could become tricky
with multiple radio buttons, to give the focus back to the appropriate
radio button in the cell.
--
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-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
BrianV
2010-11-18 04:44:58 UTC
Permalink
I took another approach but have hit a roadblock. Instead of starting
with CheckboxCell and CompositeCell, I started with the SelectionCell
figuring that it already had multiple options. Unfortunately, I
haven't figured out a way to get the "radio group" (aka "name") field
into the generated safehtml. I need a unique group per cell (for all
of the radio buttons that are created) which on the surface isn't
hard. My plan is to generate a new group name for them when "render"
is called.

The one part I'm stumped in is that I need to append some text after
the <input ..../> text. For example: <input type="radio" name"group1"
value="Goobers" /> Goobers

When I add the " Goobers" at the end, I get an exception: Content is
not allowed in trailing section. I was using a Template to generate
the SafeHTML. The template looks like the following:
@Template("<input type=\"radio\" name=\"{0}\" value=\"{1}\"/>
{1}")

I'm doing something wrong (perhaps carrying something over from the
SelectionCell I shouldn't be) but the html would seem correct. Any
ideas?
--
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-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
BrianV
2010-11-18 05:04:57 UTC
Permalink
Nevermind - I surrounded the template text with <span> </span> tags,
generated a random group name in the render method, and it all seems
to be mostly working.
--
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-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Thomas Broyer
2010-11-18 11:32:15 UTC
Permalink
Post by BrianV
Nevermind - I surrounded the template text with <span> </span> tags,
generated a random group name in the render method, and it all seems
to be mostly working.
Even better would be using <label> so that when the text is clicked
the radio button is selected.
<label><input type="radio" name="{0}" value="{1}" /> {1}</label>
--
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-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
S. DG
2012-09-10 05:33:30 UTC
Permalink
Hi,
i need some RadioButton group as well in my application, to be put in a
DataGrid or CellTable Column.Naturally i am not able to. I came across this
post and tried creating a new class similar to the SelectionCell and made
some changes but its not working properly.
I am very new to GWT for which i guess i am facing these issues.

Precisely I am able to render the radiogroup but I am not able to clear the
previously selected option when i am making a new selection is made in this
Radio Group.
Other than that i am getting exceptions in onBrowserEvent method where we
are doing select.getSelectedIndex() .
What class should we use instead of the SelectElement. So if we use the
same class do i need to rewrite the getSelectedIndex method by any chance ?

Thanks in advance.
Post by BrianV
I took another approach but have hit a roadblock. Instead of starting
with CheckboxCell and CompositeCell, I started with the SelectionCell
figuring that it already had multiple options. Unfortunately, I
haven't figured out a way to get the "radio group" (aka "name") field
into the generated safehtml. I need a unique group per cell (for all
of the radio buttons that are created) which on the surface isn't
hard. My plan is to generate a new group name for them when "render"
is called.
The one part I'm stumped in is that I need to append some text after
the <input ..../> text. For example: <input type="radio" name"group1"
value="Goobers" /> Goobers
When I add the " Goobers" at the end, I get an exception: Content is
not allowed in trailing section. I was using a Template to generate
@Template("<input type=\"radio\" name=\"{0}\" value=\"{1}\"/>
{1}")
I'm doing something wrong (perhaps carrying something over from the
SelectionCell I shouldn't be) but the html would seem correct. Any
ideas?
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/3GXo1gkbi_cJ.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Andrei
2012-09-13 03:50:47 UTC
Permalink
Received: by 10.236.192.168 with SMTP id i28mr38727yhn.7.1347508278350;
Wed, 12 Sep 2012 20:51:18 -0700 (PDT)
X-BeenThere: google-web-toolkit-/***@public.gmane.org
Received: by 10.236.124.176 with SMTP id x36ls4157215yhh.1.gmail; Wed, 12 Sep
2012 20:50:47 -0700 (PDT)
Received: by 10.236.170.7 with SMTP id o7mr40143yhl.3.1347508247960;
Wed, 12 Sep 2012 20:50:47 -0700 (PDT)
In-Reply-To: <14f786fa-1071-4c00-b9bd-ed598413da2d-/***@public.gmane.org>
X-Original-Sender: volgin-***@public.gmane.org
X-Original-Authentication-Results: ls.google.com; spf=pass (google.com: domain of
volgin-***@public.gmane.org designates internal as permitted sender)
smtp.mail=volgin-***@public.gmane.org; dkim=pass
header.i=@spiraluniverse.com
Precedence: list
Mailing-list: list google-web-toolkit-/***@public.gmane.org; contact google-web-toolkit+owners-/***@public.gmane.org
List-ID: <google-web-toolkit.googlegroups.com>
X-Google-Group-Id: 978868610581
List-Post: <http://groups.google.com/group/google-web-toolkit/post?hl=en_US>, <mailto:google-web-toolkit-/***@public.gmane.org>
List-Help: <http://groups.google.com/support/?hl=en_US>, <mailto:google-web-toolkit+help-/***@public.gmane.org>
List-Archive: <http://groups.google.com/group/google-web-toolkit?hl=en_US>
Sender: google-web-toolkit-/***@public.gmane.org
List-Subscribe: <http://groups.google.com/group/google-web-toolkit/subscribe?hl=en_US>,
<mailto:google-web-toolkit+subscribe-/***@public.gmane.org>
List-Unsubscribe: <http://groups.google.com/group/google-web-toolkit/subscribe?hl=en_US>,
<mailto:googlegroups-manage+978868610581+unsubscribe-/***@public.gmane.org>
Archived-At: <http://permalink.gmane.org/gmane.org.google.gwt/85265>

I think it's a bad idea from a user interface perspective. Imagine you have three radio buttons in a cell, and a many rows. Now your user is presented with dozens of radio buttons that take a lot of space. It would look very confusing. Use a regular SelectionCell - this is a UI concept that all users are familiar with. And you will save a lot of time :)
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/fikpYrnAwUEJ.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
S. DG
2012-09-13 05:20:29 UTC
Permalink
I understand your point.
Even i had a similar view when i was asked to implement this. But again for
Tables where we have not more 2-3 Radio choices i guess it is fine. But I
am still not clear why GWT api have not implemented this yet. People have
been looking for it for quite sometime now. I started GWT-ing just a week
back.
Anyways I am able to create my own RadioGroupCell now after reading through
this and many other blogs and breaking my head.

Thanks to all.
Post by Andrei
I think it's a bad idea from a user interface perspective. Imagine you
have three radio buttons in a cell, and a many rows. Now your user is
presented with dozens of radio buttons that take a lot of space. It would
look very confusing. Use a regular SelectionCell - this is a UI concept
that all users are familiar with. And you will save a lot of time :)
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/RJMgktN4R4kJ.
To post to this group, send email to google-web-toolkit-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
BM
2018-06-28 16:01:11 UTC
Permalink
Hey,
I know this is VERY old post. But do you know the code for RadioGroupCell?

So what I want is a cell table which has a cell Column called "Active" and
defined with one Radio button in that cell. Unlike checkboxes or custom
cell of group of radio buttons within one cell, my requirement is the Radio
buttons in all rows are part of one Group so one can select only one at a
time.

So here is what cell table would look like

Role Active
------ --------
Admin Radio Button (YES)
Role A Radio Button (NO)
Role B Radio Button (NO)

One can toggle to select only one Radio between roles.

Any help or pointers would be much appreciated.
Post by S. DG
I understand your point.
Even i had a similar view when i was asked to implement this. But again
for Tables where we have not more 2-3 Radio choices i guess it is fine. But
I am still not clear why GWT api have not implemented this yet. People have
been looking for it for quite sometime now. I started GWT-ing just a week
back.
Anyways I am able to create my own RadioGroupCell now after reading
through this and many other blogs and breaking my head.
Thanks to all.
Post by Andrei
I think it's a bad idea from a user interface perspective. Imagine you
have three radio buttons in a cell, and a many rows. Now your user is
presented with dozens of radio buttons that take a lot of space. It would
look very confusing. Use a regular SelectionCell - this is a UI concept
that all users are familiar with. And you will save a lot of time :)
--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+***@googlegroups.com.
To post to this group, send email to google-web-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
Loading...