flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Harui <aha...@adobe.com>
Subject Re: radiobuttongroup selectedindex problem
Date Mon, 19 Oct 2015 15:02:34 GMT
Well, if I understood what you are saying, it is that code in
updateDisplayList because the selected property on the RadioButtons are
affecting the results and that’s what that code does:  it checks the
selected property and alters the selection in the group.

Callouts and other popups get initialized slightly differently than things
in the main app (no phased instantiation) so that could be why this only
happens in the callout.

By not setting selected on any RadioButtons and only setting the group’s
selectedIndex, the code in updateDisplayList probably has less effect.


On 10/19/15, 1:29 AM, "Frank Dahmen" <frank@dahmenia.de> wrote:

>So, really weird (I'm still using Flex 4.12.1 !):
>it is the callout
>when you put radiobuttons in a callout the pre-selection gets messed up
>what works is to set creationComplete="myGroup.selectedIndex=1"
>in the callout but ONLY if the radiobutton is NOT set to selected="true"
>i think it's not the updateDisplayList function in radiobutton
>I tested it like this:
>public class MRadioButton extends RadioButton
>     {
>         public function MRadioButton()
>         {
>             super();
>         }
>         override protected function
>updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
>         {
>             trace("before: " + this.group.selectedIndex);
>             super.updateDisplayList(unscaledWidth, unscaledHeight);
>             trace("after: " + this.group.selectedIndex);
>         }
>     }
>when the selection got messed up, both traces showed the same, wrong
>index:0 (instead of 1)
>Am 18.10.2015 um 22:53 schrieb Alex Harui:
>> On 10/18/15, 10:26 AM, "Frank Dahmen" <frank@dahmenia.de> wrote:
>>> callLater doesn't help
>>> the radiobuttons of each group are in separate HGroups,
>>> which are visible="false" and includeInLayout="false"
>>> and can be shown by a checkbox
>>> may this cause this behaviour?
>>> although I'm asking for the groups property which is set manually to
>>> selectedIndex=1, as said,
>>> not for the state of a button
>>> or more precise:
>>> does changing the visibility and "layoutinclusion" of a radiobutton can
>>> have an effect on the selectedIndex of the button's
>>> group..........SOMETIMES?
>> I took a look at RadioButton.  There is some strange code in its
>> updateDisplayList method, so yes, flipping visibility could trigger an
>> updateDisplayList and mess up selection.  I suppose that changing
>> and includeInLayout on the Hgroup could trigger updateDisplayList on the
>> RadioButtons in certain scenarios, like if the browser is running the
>> at different sizes on the problem machines and scrollbars are being
>> added/removed or the callout doesn’t display in its usual size and/or
>> position.
>> HTH,
>> -Alex

View raw message