but if it was the updateDisplayList function, shouldn't the traces then
be different?
anyway, the 2nd button is selected while the groups selectedIndex
property is 0
isn't this a bug?
Am 19.10.2015 um 17:02 schrieb Alex Harui:
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.
-Alex
On 10/19/15, 1:29 AM, "Frank Dahmen" <[email protected]> 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" <[email protected]> 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
visible
and includeInLayout on the Hgroup could trigger updateDisplayList on the
RadioButtons in certain scenarios, like if the browser is running the
app
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