1 Reply Latest reply on Feb 27, 2011 5:56 AM by uajmal

    Problem with accessing a label's value in an accordian's selected child

    uajmal Level 1
      I have an Accordian in my application. Each child of the accordian has a label (firstNameLabel) and a button (addPolicyButton). The label's value is being set via Repeater and an array.

      How can I access the firstNameLabel's value of 'selected child of the accordian' when the addPolicyButton is clicked?


      In following code testTextArea.appendText prints 'fname: undefined' in the testTextArea.
      Where as I can see in the accordian that the set label's text is set to 'Michael' which is what repMonitor.currentItem.firstName returned.





      private function addPolicy(firstName:String ):void{

      <mx:Accordion id="monAccordian" includeIn="Monitoring" x="10" y="10" width="554" height="242" change="monAccordianChange()" >
      <mx:Repeater id="repMonitor" dataProvider="{monitoringArray}">
      <mx:Canvas width="100%" height="100%" label="{repMonitor.currentItem.firstName}" >
      <s:Label id="firstNameLabel" text="{repMonitor.currentItem.firstName}"/>
      <mx:Button x="450" y="8" id="addPolicyButton" label="Modify policy" click="addPolicy();" visible="true"/>

      <s:TextArea x="138" y="30" enabled="true" id="testTextArea" x.MainPage="80" y.MainPage="100" visible="true"/>


      Message was edited by: uajmal