Skip navigation
Currently Being Moderated

StyleableTextfield  <b> misbehaving in renderer

Jun 12, 2013 4:21 PM

Tags: #renderer #htmltext #styleabletextfield

Hello Everyone,

  I am having issues with a StyleableTextField and htmlText in my renderer.  The htmlText property I am setting has <b>...</b> in it, however, when the list first renders, I don't see the bold effect in place.  However, if I scroll down then back up, I can see the <b> effect applied.  The bolding text is applied in a getter method of my model, so there is no way for the StyleableTextField to ever get it unprocessedd and none of the STFs are ever empty.  My garbage renderer looks like this if it helps

 

Any help is greatly appreciated, and I have no clue of why the formatting is the way it is.

 

 



override public function set data(value:Object):void


{



super.data = value;



if( value )



{




var funkShowMatch:FunkShowMatch= value as FunkShowMatch;




_showName = funkShowMatch.showName;




_cityState = funkShowMatch.cityState;




_zipCode = funkShowMatch.zipCode;




_showDates = funkShowMatch.showDates;





}



else



{




_showName = "";




_cityState = "";




_zipCode = "";




_showDates = "";



}








_showDatesLabel.htmlText = _showDates != null ? _showDates : "";



_showNameLabel.htmlText = _showName != null ? _showName : "";


}










override protected function createChildren():void


{




if (!_showDatesLabel)



{




createShowDatesLabelDisplay();




_showDatesLabel.htmlText = _showDates != null ? _showDates : "";



}



if (!_showNameLabel)



{




createShowNameLabelDisplay();




_showNameLabel.htmlText = _showName != null ? _showName : "";






}




}










protected function createShowDatesLabelDisplay():void


{



_showDatesLabel = StyleableTextField(createInFontContext(StyleableTextField));



_showDatesLabel.styleName = this;



_showDatesLabel.editable = false;



_showDatesLabel.selectable = false;



_showDatesLabel.multiline = false;



_showDatesLabel.wordWrap = false;








addChild(_showDatesLabel);


}


protected function createShowNameLabelDisplay():void


{



_showNameLabel = StyleableTextField(createInFontContext(StyleableTextField));



_showNameLabel.styleName = this;



_showNameLabel.editable = false;



_showNameLabel.selectable = false;



_showNameLabel.multiline = false;



_showNameLabel.wordWrap = false;



_showNameLabel.setStyle("fontSize" , 15 );



addChild(_showNameLabel);


}






override protected function measure():void


{



var horizontalPadding:Number;



var verticalPadding:Number;








if (_showDatesLabel)



{




if (_showDatesLabel.isTruncated)





_showDatesLabel.htmlText = _showDates;










horizontalPadding = getStyle("paddingLeft") + getStyle("paddingRight");




verticalPadding = getStyle("paddingTop") + getStyle("paddingBottom");










_showDatesLabel.commitStyles();




measuredWidth = getElementPreferredWidth(_showDatesLabel) + horizontalPadding;










measuredHeight = getElementPreferredHeight(_showDatesLabel) + verticalPadding;










trace( "Show Dates Label Width: " + measuredWidth );




trace( "Show Dates Label Height: " + measuredHeight );




trace( "Show Dates Label Text: " + _showDatesLabel.text  );



}



if (_showNameLabel)



{




if (_showNameLabel.isTruncated)





_showNameLabel.text = _showName;










horizontalPadding = getStyle("paddingLeft") + getStyle("paddingRight");




verticalPadding = getStyle("paddingTop") + getStyle("paddingBottom");










_showNameLabel.commitStyles();




measuredWidth = getElementPreferredWidth(_showNameLabel) + horizontalPadding;




measuredHeight = getElementPreferredHeight(_showNameLabel) + verticalPadding;










trace( "Show Name Label Width: " + measuredWidth );




trace( "Show Name Label Height: " + measuredHeight );




trace( "Show Name Label Text: " + _showNameLabel.text  );



}



measuredMinWidth = 0; 




}
 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points