Wednesday, April 23, 2014

Re: RadioButton does not get selected when setValue is called & events not fired in IE

dhoffer <dhoffer6@...> writes:

>
> I have two RadioButtons on a panel, each have an
> addValueChangeHandler() listener. Later after all the widgets are
> created and added to the panelI call readiobutton1.setValue(true,
> true) to both set it as selected and to fire events which the
> addValueChangeHandler() listener should pickup.
>
> However here is what happens.
>
> - Most of the time the selected RadioButton is not enabled, that is,
> neither of the RadioButtons are selected when the panel loads.
> However most of the time the event is fired/caught which causes other
> buttons to be enabled/disabled.
>
> - However in IE, most of the time the event (above) is not fired.
> Well actually all I can see is that the results of the event do not
> happen so it must not be fired.
>
> Am I doing something wrong? What is the right way to create
> RadioButtons with a default one and then have a listener to act based
> on what is selected either by the user or by code?
>
> Thanks much!
>


So, this has been driving me insane for almost a day.

Finally I have figured out how to get this to work. I presume it isn't
working because the widget hasn't been attached to the DOM. I haven't a
clue why this should matter to the browser, but I have found that putting
the RadioButton.setValue(<state>,<state>) works fine after the item has been
added to the initialized widget!

I know this is an old post, but I couldn't find a work around anywhere!

--
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.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment