1 Reply Latest reply on Feb 22, 2010 4:07 PM by Flex harUI

    Issue with alert.show

    JohnMerlino Level 1

      Hey all,


      I have a DataGrid which is fed xml through an httpservice. When the user clicks on one of rows in the DataGrid, I would like to display more information about that specific record. But the problem is when I click on an item in a row, absolutely nothing happens. Here's what I have used:


                  import mx.core.IFlexDisplayObject;
                  import mx.managers.PopUpManager;
                  import mx.controls.dataGridClasses.DataGridItemRenderer;
                  import mx.events.ListEvent;
                  import mx.controls.Alert;


                  private var user_requests:XML;
                  private const CONTEXT_URL:String = "http://localhost:3000";
                  public function init():void
                      this.user_requestsGrid.addEventListener(ListEvent.ITEM_CLICK, itemClicked);
                  private function itemClicked(le:ListEvent):void
                      var itemContents:XML = this.user_requestsGrid.selectedItem as XML;

                      var detailContents:XMLList = itemContents.user_request;

                      var colInd:int = le.columnIndex;

                      var value:String = detailContents.children()[colInd];   
                      if (value != null)
                          Alert.show(value, "user_request");




              <mx:HTTPService id="user_requestsIndex" url="{CONTEXT_URL}/user_requests.xml"
                              resultFormat = "e4x"
                              result="user_requests=event.result as XML"/>
              <mx:HTTPService id="user_requestsCreate" url="{CONTEXT_URL}/user_requests.xml"
                              method = "POST"
              <mx:HTTPService id="user_requestsUpdate" url="{CONTEXT_URL}/user_requests/{user_requestsGrid.selectedItem.id}/confirm_request"
                              resultFormat = "e4x"
                              headers="{{X_HTTP_METHOD_OVERRIDE: 'PUT'}}" />


              <mx:DataGrid  id="user_requestsGrid"     
                      <mx:DataGridColumn headerText="User Request" dataField="id" editable="true"/>
                      <mx:DataGridColumn  headerText="Status" dataField="user_request_status_id" editable="true"/>





      Any suggestions? All I am trying to do is when a user clicks on a row (which corresponds to a record), a pop up is invoked which shows all the subset of data for that specific record:

      <user_requests type="array">

      <created_at type="datetime">2010-02-22T19:49:41Z</created_at>
      <updated_at type="datetime">2010-02-22T19:49:41Z</updated_at>


      Thanks for any response.