title: OK button in a dialog popup not working in flex
body: <p>I am new to learning flex and I have this application which opens up a popup displays some checkbox values and the once the user clicks the OK button populates an array and then closes. But in my code, when I click the OK button nothing happens.</p>
  
  <pre><code> private function closeDialog(event : CloseEvent) : void {
          PopUpManager.removePopUp(this); // close this dialog
      }
  
      private function onClickOK (event : CloseEvent) : void {
             var values:ArrayCollection = new ArrayCollection();
          for (i = 0; i &lt; table.length; i++) {
              var row:Array = table.getItemAt(i);
              if (row["selected"]) {
                  var valueRow:Array = new Array();
                  arrayRow["colA"] = row["colA"];
                  values.addItem(valueRow);
              }
          }
  
          page.model["choosenvalues"] = values;
  
          closeDialog(event);
      }
  </code></pre>
  
  <p>And here is the flex code</p>
  
  <pre><code>   &lt;mx:VBox paddingLeft="10" paddingRight="10"&gt;
      &lt;mx:HBox width="100%" height="100%"&gt;
          &lt;mx:Spacer width="2%" /&gt;
          &lt;mp:Table id="selectTable" dataProvider="{table}" title="" height="350"&gt;
              &lt;mp:columns&gt;
                  &lt;mx:AdvancedDataGridColumn dataField="selected" headerText="  "  editable="true" textAlign="center" minWidth="36" width="36" paddingLeft="0" paddingRight="0"&gt;
                      &lt;mx:itemRenderer&gt;
                          &lt;mx:Component&gt;
                              &lt;mx:CheckBox width="18" click="{data.selected = !data.selected}" label="" paddingLeft="0" paddingRight="0"/&gt;
                          &lt;/mx:Component&gt;
                      &lt;/mx:itemRenderer&gt;
                  &lt;/mx:AdvancedDataGridColumn&gt;
                  &lt;mx:AdvancedDataGridColumn headerText="Column A" minWidth="240" dataField="colA"/&gt;
  
              &lt;/mp:columns&gt;
          &lt;/mp:Table&gt;
      &lt;/mx:HBox&gt;
      &lt;mx:HBox width="100%"&gt;
          &lt;mx:Spacer width="85%" /&gt;
          &lt;mx:Button label="OK" click="onClickOK(null)" enabled="true"/&gt;
          &lt;mx:Button label="Cancel" click="closeDialog(null)"/&gt;
      &lt;/mx:HBox&gt;
  &lt;/mx:VBox&gt;
  </code></pre>