1 Reply Latest reply on Feb 1, 2008 8:38 PM by ntsiii

    States inside a Repeater

      hi all!

      i have this problem: i have a repeater component binded with an xml stream taken from a db.
      By now it displays a label and an image. What i wanna do is enlarge the current elements clicked by the user adding additional informations about the clicked product (all the informations are in that xml stream).
      The code i wrote is something like this:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="dataRequest.send()"
      xmlns:flexlib=" http://code.google.com/p/flexlib/">

      <mx:HTTPService id="dataRequest" url=" http://localhost:8084/infoflex/SampleServlet"

      <mx:State name="itemExpanded">
      <mx:AddChild relativeTo="{itemBox}">
      <mx:Label text="Formato:"/> <mx:Label text="{listaMaterialeIstituz.currentItem.des_fmo}"/>

      import mx.utils.StringUtil;

      <mx:Panel title="Materiale Istituzionale" height="100%" width="100%">
      <mx:Label text="Il Materiale Istituzionale andra' qua!!"/>

      <mx:Repeater id="listaMaterialeIstituz" dataProvider="{dataRequest.lastResult.qresults.row}">
      <mx:HRule width="100%"/>

      <mx:HBox id="itemBox" click="currentState='itemExpanded'">
      <mx:Label text="{listaMaterialeIstituz.currentItem.des_mte_arc_fot}" width="80%" />
      <flexlib:Base64Image source="{StringUtil.trim(listaMaterialeIstituz.currentItem.img_bassa)}"/>

      But trying to compiling this i get the error: "Implicit coercion of a value of type Array to an unrelated type mx.core:UIComponent" at the line 12...namely <mx:AddChild relativeTo="{itemBox}">.

      What am i doing wrong here??

      thanks in advance!