<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
private function addGroupNames(event:Event):void{
for(var i:int = 0;i<yes.length;i++){
yes[i].groupName = "group"+i;
no[i].groupName = "group"+i;
no[i].selected = true;
}
}
private function changeData():void{
datarr = datarr.concat(datarr2);
}
]]>
</mx:Script>
<mx:ArrayCollection id="dat">
<mx:Array id="datarr">
<mx:Object question="Question 1a" answer="yes"/>
<mx:Object question="Question 2a" answer="yes"/>
<mx:Object question="Question 3a" answer="yes"/>
<mx:Object question="Question 4a" answer="yes"/>
<mx:Object question="Question 5a" answer="yes"/>
<mx:Object question="Question 6a" answer="yes"/>
</mx:Array>
</mx:ArrayCollection>
<mx:ArrayCollection id="dat2">
<mx:Array id="datarr2">
<mx:Object question="Question 1b" answer="yes"/>
<mx:Object question="Question 2b" answer="yes"/>
<mx:Object question="Question 3b" answer="yes"/>
<mx:Object question="Question 4b" answer="yes"/>
<mx:Object question="Question 5b" answer="yes"/>
<mx:Object question="Question 6b" answer="yes"/>
</mx:Array>
</mx:ArrayCollection>
<mx:VBox>
<mx:HBox>
<mx:Text text="Yes"/>
<mx:Text text="No"/>
</mx:HBox>
<mx:Repeater id="rp" repeatEnd="addGroupNames(event)" dataProvider="{datarr}">
<mx:HBox width="100%">
<!-- breaks if you use groupName="{rp.currentIndex}"-->
<mx:RadioButton id="yes" groupName="{rp.currentIndex}" name="Yes"
label="" labelPlacement="right"/>
<!-- breaks if you use groupName="{rp.currentIndex}"-->
<mx:RadioButton id="no" groupName="{rp.currentIndex}" name="No"
label="" labelPlacement="right"/>
<mx:Text width="240" htmlText="{rp.currentItem.question.toString()}"
selectable="false" />
</mx:HBox>
</mx:Repeater>
<mx:Button label="Change Data" click="{changeData()}"/>
</mx:VBox>
</mx:Application>
--- In [email protected], "Benoit Hediard" <[EMAIL PROTECTED]> wrote:
>
> Hi Jason,
>
> Yes, I found one workaround to this issue.
> Use the repeatEnd event to execute a function that will assign the groupName
> to each one of your RadioButton.
> Use also this function to assign the selected button (because the bindings
> are a source of the problem).
>
> Benoit Hediard
>
> -----Message d'origine-----
> De : [email protected] [mailto:[EMAIL PROTECTED] De la
> part de Jason
> Envoyé : jeudi 24 août 2006 18:11
> À : [email protected]
> Objet : [flexcoders] Re: Flex 2 Final : Error #1009, in RadioButton/get
> labelPlacement()
>
> Has anyone found a workaround to the bug with RadioButton groups and
> repeater components described here? I have having this same problem.
>
> --jason
>
> --- In [email protected], "Benoit Hediard" ben@ wrote:
> >
> > I've investigated this issue a little bit more.
> > It looks like there some problems with RadioButton when they are used
> > in groups.
> > First display is generally correct, but when the display list is
> refreshed,
> > it generates some bugs.
> >
> > In our case, the RadioButton group is used in a popup, and even
> after the
> > popup is deleted, some popup display routines are still executed.
> >
> > When debugging is on, the error is generated in RadioButton.as, at
> line 172,
> > because the property group is null :
> > if (_labelPlacement != "") {
> > value = _labelPlacement;
> > } else if (_group && group.labelPlacement != "") { // L.172
> > value = group.labelPlacement;
> > }
> >
> > Workaround : always define labelPlacement in all your RadioButton
> (so that
> > the group labelPlacement is never read).
> >
> > I've also encountered a similar error in another case : RadioButton
> groups
> > used inside a Repeater, with the groupName defined during the repeater
> > execution (groupName="{theRepeater.currentIndex}").
> > First execution is correct, but the next ones generate an error.
> >
> > When debugging is on, the error is generated in the RadioButton.as,
> at line
> > 454, for the same reason (property group is null) :
> > var g:RadioButtonGroup = group:
> > g.addInstance(this); // L.454
> >
> > I haven't found a workaround for this one.
> >
> > It's too bad because all of this was working in previous beta but
> not on the
> > final release ;).
> >
> > Benoit Hediard
> >
> > _____
> >
> > De : [email protected] [mailto:[EMAIL PROTECTED]
> De la
> > part de Benoit Hediard
> > Envoyé : lundi 3 juillet 2006 12:36
> > À : [email protected]
> > Objet : [flexcoders] Flex 2 Final : Error #1009, in RadioButton/get
> > labelPlacement()
> >
> >
> > Error #1009: Il est impossible d'accéder à la propriété ou la
> méthode d'une
> > référence d'objet nul.
> > (in english, something like "it is not possible to access the
> property or
> > the method of the null object reference") at
> > mx.controls::RadioButton/get labelPlacement() at
> >
> mx.controls::Button/http://www.adobe.com/2006/flex/mx/internal::layoutConten
> > ts()
> > at mx.controls::Button/mx.controls:Button::updateDisplayList()
> > ...
> >
> > In Flex2 final, I'm getting this error regularly...
> > Not tried yet to reproduce it on a simple regular case, but it looks
> like
> > pretty random.
> > I don't use the labelPlacement property in our app.
> >
> > I've never encountered this error in previous beta, only since the FP9
> > /
> > Flex2 Final.
> > Looks like a very annoying low level framework error, related to the
> layout
> > of RadioButtons.
> >
> > Anyone else facing this issue?
> > And found a workaround?
> >
> > Benoit Hediard
> >
>
>
>
>
>
>
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
> Yahoo! Groups Links
>
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
| Software development tool | Software development | Software development services |
| Home design software | Software development company |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___

