Hi there,
I have the following question regarding Radio Buttons. I have added a
RadioButton to an inner class as follows:
class ServerStatsUpdater extends AbstractAsyncHandler
{
public void handleFailure(Throwable caught){
}
public void handleSuccess(Object result){
I think you just need a clicklistener don't you? And then check the state of
the radiobutton.
Same thing as http://examples.roughian.com/#Widgets~CheckBox
or have a look at http://examples.roughian.com/#Listeners~ClickListener
Ian
--~--~-~--~~~---~--~~
You
Hi,
Cheers for your reply. The example does not say how to use it for
Radio Buttons. I can not get my head round how to implement a click
listener for a Radio button. You can only have 2 parameters for a
radio button, and I am already using 2. The examples seem to add a
click listener as a
You can't do everything in one statement (well, actually you can, but it
gets unreadable and unless you are a C programmer, you won't want to do it
like that)
RadioButton rb = new RadioButton(group, radioButtonText);
rb.addClickListener(listener);
editItemsRadioPanel.add(rb);
Ian
Thanks for your reply. I now have the click listener working for the
Radio Buttons. However, I now have a new problem. I need to get the
text associated with the Radio Button and put into a String. So at the
moment I have:
ClickListener listener = new ClickListener()
{
public void
RadioButtons are a pain like that.
Obviously I don't really know what you are doing with this, but one option
would be to subclass RadioButton. You can then have it listen to itself, and
fill a static field with the last selected text, or have a static field
which contains the currently selected
I basically just need to extract the text that is associated with the
'radioButtonText' field when an item is selected. (I will then send
this value back to the server, to be used as part of an SQL
statement).
Can you give an example of how to use a subclass RadioButton? I have
never used
Something like this:
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.Widget;
class MyRadioButton extends RadioButton implements ClickListener
{
private static MyRadioButton currentButton = null;