0 Replies Latest reply on Sep 7, 2007 2:42 AM by P Steven

    Content not appearing after first time

    P Steven Level 1
      I could really do with some help on this one.

      I have a screen (State) in my application that displays some custom mxml components using a repeater. The first time I come to this screen, all the data appears correctly. However if I navigate away from this screen to another screen (State), then return to it, all that appears is a scroll bar, with no custom components appearing.

      I would appreciate if anyone can take a peek at my code below to try and identify the problem. Perhaps this is a problem others have experienced?

      The relevant code is as follows:

      <mx:State name="ComponentFolderScreen" basedOn="QualificationSummaryScreen">
      <mx:RemoveChild target="{qualificationSummaryScreenDG}"/>

      <mx:AddChild relativeTo="{vbox1}" position="lastChild">
      <mx:Tile autoLayout="true" width="740" height="230" id="tile1" borderStyle="none">

      <mx:Repeater id="productsRepeater" dataProvider="{this.category1}" >

      <local:ComFolderItem mouseOver="CFSMouseOver_Folder(event)" click="CFSClick_Folder(event)" studentName='{productsRepeater.currentItem.productName + "(" + productsRepeater.currentItem.productPrice + ")"}' componentStatus='{productsRepeater.currentItem.componentStatus}' >

      </local:ComFolderItem>

      </mx:Repeater>
      </mx:Tile>
      </mx:AddChild>

      </mx:State>


      And here is the code that populates the ArrayCollection that is the dataprovider

      var ComponentFolderData:ArrayCollection = new ArrayCollection();

      ComponentFolderData = _dataManager.returnComponentFolderData(componentCode);

      var howManyObjects:uint = ComponentFolderData.length;

      var objectInstance:Object = new Object();

      category1 = new ArrayCollection();

      for (var objectIndex:uint = 0; objectIndex < howManyObjects; objectIndex++) {

      objectInstance.productName = ComponentFolderData.getItemAt(objectIndex).productName;
      objectInstance.componentStatus = ComponentFolderData.getItemAt(objectIndex).componentStatus;

      category1.addItem(objectInstance);