7 Replies Latest reply on Jan 26, 2011 1:43 PM by mitchgrrt

    Flex 4 ClassFactory properties don't sets.



      I just loaded my Flex 3 project in Flex 4 and discover this big problem.


      I will add buttons in a DataGrid.

      I call this function in my DataGrid component to add button to the DataGrid dynamic.



      // function in my DataGridClass
      public function addButton(name:String,type:String):void{
         var columns:Array = this.columns;
         var buttonCol:DataGridColumn = new DataGridColumn();
         var buttonRenderer:ClassFactory = new ClassFactory(PIGridButton);
         buttonCol.minWidth = 30;
         buttonCol.width = 30;
         buttonRenderer.properties = {toolTip: name, buttonType : type};
         buttonCol.resizable = false;
         buttonCol.itemRenderer = buttonRenderer;
         this.columns = columns;
      // Class GridButton
      public class PIGridButton extends LinkButton {
           private var _buttonType:String;
           public function PIGridButton() {
              this.addEventListener(MouseEvent.CLICK, myClickHandler);
           public function set buttonType(type:String):void {
              this._buttonType = type;
           private function myClickHandler(event:MouseEvent) : void {
              this.dispatchEvent(new Event(_buttonType,true,true));


      But in Flex 4 i dont set the _buttonType or any of the other properties.

      What is the problem?

      How can i fix it?