Hmm, I am not at all used to interpreting that object dump. But is doesn't look like I expected. For this to work as a dataProvider, it needs to be something like:
oQuestion1 --text (the question text) --aAnswers (an array of answers) ----answer[0] ----answer[1] oQuestion2 --text --aAnswers ----answer[0] ----answer[1] ... Do you see the theory? For a nested repeater, its data must be nested within the data for its parent. The outer repeater is fed by an array of oQuestion objects. You would display say text by saying repeater.currentItem.text. The inner repeater dataProvider would be repeater.currentItem.aAnswers array, and each answer element would create an inner repeater element. Again, I advise XML. It is much easier to undersand and work with. Just have the CF procedure build an xml string, an pass that back to Flex. Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy Crane Sent: Tuesday, January 30, 2007 2:46 PM To: [email protected] Subject: [flexcoders] Re: Nested Repeater problem Here is an example of the output returned in one instance: ( Object)#0 1 = (Object)#1 ANSWERS = (Object)#2 1 = "76-100%" QUESTION = "What percentage of yoru time is spent in the office?" 2 = (Object)#3 ANSWERS = (Object)#4 1 = "0-25%" QUESTION = "What percentage of your time is spent in your vehicle/on the road?" 3 = (Object)#5 ANSWERS = (Object)#6 1 = "pens/pencils" QUESTION = "What promotional item could be provide for you that would help you?" --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > What does your data look like in Flex? I don't read cf. You can > ObjectUtil.toString() method to display the object. > > > > Tracy > > > > ________________________________ > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On > Behalf Of bulldog65mustang > Sent: Tuesday, January 30, 2007 10:58 AM > To: [email protected] <mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Re: Nested Repeater problem > > > > I have modified the dataprovider to that of an Object. I have > coldfusion returning a struct: > > <cfset responses[#variables.loopIndex#] = StructNew()> > <cfset responses[#variables.loopIndex#].question = > #qry_questions.QuestionText#> > <cfset responses[#variables.loopIndex#].answers = StructNew()> > > I am still having problems extracting the data from the Object using a > repeater. The following is only supposed to display the questions, > but doesn't. What is my problem? > > <mx:Repeater id="rp_question" dataProvider="{obj_responses}" > > <mx:VBox width="100%"> > <mx:Text id="qtext" width="100%" fontWeight="bold"> > <mx:text>{rp_question.currentIndex + 1}.) > {rp_question.currentItem.QUESTION.toString()}</mx:text> > </mx:Text> > </mx:VBox> > </mx:Repeater> > > --- In [email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > , "Tracy Spratt" <tspratt@> wrote: > > > > The data for each item in the nested repeater must be nested in the > > dataProvider for the main repeater. You pass the appropriate part of > > the main dataProvider to the nested repeater using currentItem. > > > > > > > > Of course, you will need to use an AsyncToken when you call the answer > > RO, so that in its resultHandler you can associate the correct data > with > > the correct item at the main repeater level. I'd use XML for this. > > > > > > > > Also, it would be better to build this data on the server, and pass > the > > whole datqaProovider at once. If that is an option. > > > > > > > > Tracy > > > > > > > > ________________________________ > > > > From: [email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > ] On > > Behalf Of bulldog65mustang > > Sent: Friday, January 26, 2007 1:20 PM > > To: [email protected] <mailto:flexcoders%40yahoogroups.com> <mailto:flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Nested Repeater problem > > > > > > > > I have a situation where I need to call a RemoteObject that returns a > > set of questions. I set the dataProvider of my Repeater to this > > ArrayCollection. The Result Handler of this RO loops through the > > ArrayCollection and calls another RO to retreive the answers( may have > > > multiple answers per question). the problem I have is that each > > answer for the questions retreived are the answer of only the last > > question. I know why this is occuring, I have the same dataProvider > > being used for the inner Repeater. > > > > My question is how can I fix this. I have tried to insert the answer > > results from each question into an Array, but I cannot get the > > Repeater to work when I try this. > > >

