0 Replies Latest reply on Apr 12, 2007 8:29 AM by cfortin14

    CellRenderer – Class returns an undefined value

    cfortin14 Level 1
      I’m trying to display 3 lines in a list box. I have the code to render the cell but I can’t make it work. Can someone please help me determine why this code is not returning the correct value?

      Class Code:
      import mx.core.UIComponent

      class HtmlLabelCellRenderer extends UIComponent
      {
      var label : MovieClip;

      function HtmlLabelCellRenderer() {}

      function createChildren(Void) : Void {
      label = createObject("Label", "label", 1, {styleName:this, owner:this});
      label.html = true;
      label.multiline = true;
      label.wordWrap = true;
      size();
      }

      function size(Void) : Void {
      label.setSize(__width, __height);
      label._x = 0;
      label._y = 0;
      }

      function setValue(str:String, item:Object, sel:Boolean) : Void {
      //label._visible = (item!=undefined);
      label.text = item.label;
      }

      function getPreferredHeight(Void) : Number {
      return 18;
      }

      function getPreferredWidth(Void) : Number {
      return __width;
      }
      }