Tuesday, February 5, 2013

Re: radiobutton.setValue not working?

And it shouldn't work! You are setting just a string to the menu item

"this.getElement().setInnerHTML( html );"

It's not a widget! And you can't change the "html" value dinamicaly by changing the radio button state.

понедельник, 14 сентября 2009 г., 13:47:42 UTC+3 пользователь TomJanssens написал:
Hello,

I am trying to include a radiobutton in a menuitem. When the menuItem
is clicked, the checked state of the radiobutton (and other
radiobuttons in the same group) should be updated.

My design roughly lookes like this.

public class RadioMenuItem extends MenuItem {

public RadioMenuItem  {
...
button = new RadioButton( "group", text );

String html = button.getElement().getInnerHTML();
this.getElement().setInnerHTML( html );
...
}
}

in the Command.Execute of the MenuItem I am trying to change the value
of the radiobutton. (GWT does not support the html label for feature).

I have already tried

button.setChecked(true);
button.setValue(true);
button.setValue(true, true);

but none of them updates the radio button state.

If I click the radiobutton, everything works fine as this is by
default supported in GWT, however if the label of the radiobutton is
clicked nothing happens. My Command.Execute method is executed, but
the state does not change.

Any ideas are welcome.

Cheers
Tom

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

No comments:

Post a Comment