1 Reply Latest reply on Mar 31, 2010 11:29 AM by RajaFlex

    htmlText in Dynamic TextArea in Repeater is not displaying text in last iteration.

    RajaFlex Level 1

      Hi,

       

      I am facing a strange error. The htmlText in DynamicTextArea control in Repeater is not displaying text in the last iteration. It is setting the space for the dynamic text area, but not displaying the text in the last iteration. My code as below.

       

      <mx:Repeater id="rowsRepeater" dataProvider="{stepsRepeater.currentItem.rows.row.fields}">
      <mx:VBox id="rowsVB" verticalGap="0" borderStyle="none" verticalScrollPolicy="off" horizontalScrollPolicy="off" resizeEffect="Resize" width="899">
      <mx:Spacer width="30"/>
      <mx:HBox width="840" horizontalAlign="center" resizeEffect="Resize" paddingLeft="10" verticalScrollPolicy="off" horizontalScrollPolicy="off">
      <mx:CheckBox id="checkBox" width="110" paddingLeft="30" change="chkBoxChange(event.currentTarget.instanceIndices)"
           selected="{(rowsRepeater.currentItem.field.(@ID=='CHECKBOX').@value == 'Y') ? checkBox.selected=true : checkBox.selected=false}"/>
      <mx:Label id="title" text="{rowsRepeater.currentItem.field.(@ID=='TITLE').@value}" styleName="T18" textAlign="left" width="444"/>
      <mx:Label id="optional" text="{rowsRepeater.currentItem.field.(@ID=='OPT').@value}" styleName="T18" textAlign="left" width="150"/>
      <mx:LinkButton id="show" label="{rowsRepeater.currentItem.field.(@ID=='SHOW').@value}" styleName="L4"
            alpha="0" textAlign="left" width="0" click="showHideDetails(event.currentTarget.instanceIndices,event)" visible="false"/>
      <mx:LinkButton id="hide" label="{rowsRepeater.currentItem.field.(@ID=='HIDE').@value}" styleName="L4"
             alpha="0" textAlign="left" width="100" click="showHideDetails(event.currentTarget.instanceIndices,event)" visible="true"/>
      </mx:HBox>
      <mx:VBox id="descHB" visible="true" width="561" horizontalAlign="left" resizeEffect="Resize" paddingLeft="128" paddingTop="0" paddingBottom="0" verticalScrollPolicy="off" horizontalScrollPolicy="off">
      <comp:DynamicTextArea id="textDesc" width="432" paddingLeft="0" paddingTop="0" selectable="true" styleName="T18" 
                                              htmlText="{String(rowsRepeater.currentItem.field.(@ID=='DESCR').@value)}" link="taLinkHandler(event)"
                                              textAlign="left" borderStyle="none" borderThickness="0"                                         creationComplete="setup(event.currentTarget.instanceIndices,event)"
                                              condenseWhite="true" wordWrap="true" editable="false" />

      </mx:VBox>
      <mx:HRule width="100%" height="1"/>
      <mx:Spacer width="30"/>
      </mx:VBox>
      </mx:Repeater>

       

      The setup funtion in my code will set the hyperlink color on hovering on it.

       

      private var _hoverStyles:String = "a:hover { color: #ff00ff; text-decoration: underline; } a { color: #1c56ea; text-decoration: underline; }";

       

      private function setup(obj:*,eve:Event):void{
                      var ss:StyleSheet = new StyleSheet();
                      ss.parseCSS(_hoverStyles);
                      var descIndex:String =  new String(obj);
                      var stepNumber:int = new Number(descIndex.substr(0,1));
                      var rowNumber:int = new Number(descIndex.substr(2,1));
                      textDesc[stepNumber][rowNumber].styleSheet = ss;

      }

       

      Can anyone please help me?

       

      Thanks,

      Raj.