19 Replies Latest reply on Nov 3, 2010 7:26 PM by YuHsin4221123

    Retrieve data from datagrid

    YuHsin4221123 Level 1

      Hi people,

       

      Currently I trying to create a datagrid that allows user to see the overview data. And the datagrid allow the user to click and a popup will show a more detail information of the data

       

      But I'm having problem to retrieve the id of the data first. I've managed to create a click event to allow the user to click a specific data and shows popup.

       

       

      I need help regarding this. Thanks

       

      -ExpertDiscoverySystem.mxml-

       

                  [Bindable]
                  public var dataid:String;
                  private function onItemClick( e:ListEvent ):void {
                  //    currentState='SearchName';
                      //add popup here, then try to transfer a certain field to display all the required data
                  titleWindow = PopUpManager.createPopUp(this, component.DataDetail, true) as TitleWindow;
                  PopUpManager.bringToFront(titleWindow);
                  var dataid:String = e.currentTarget.selectedTarget.id;
                  }

       

      <mx:Panel width="1169" height="558" layout="absolute" title="Datagrid" x="48.7" y="171.65" includeIn="SearchResult">
              <mx:Label horizontalCenter="0" y="1" text="Results"
                        fontSize="16" fontWeight="bold"/>
              <mx:DataGrid id="dgPeeps" width="1141" height="487" selectedIndex="0" showHeaders="false" x="16.6" y="24" creationComplete="dgPeeps_creationCompleteHandler(event)" itemClick="onItemClick(event);" dataProvider="{getContentForAllResult.lastResult}">
                  <mx:columns>
                      <mx:DataGridColumn dataField="img" itemRenderer="component.image"/>
                      <mx:DataGridColumn headerText="name" dataField="name" />
                      <mx:DataGridColumn headerText="department" dataField="department"/>
                      <mx:DataGridColumn headerText="expert" dataField="expert"/>
                      <mx:DataGridColumn headerText="project" dataField="project"/>
                      <mx:DataGridColumn dataField="id"/>
                  </mx:columns>
              </mx:DataGrid>
          </mx:Panel>

       

      -DataDetail.mxml- The popup component

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" width="700" height="600" backgroundColor="#000000" backgroundAlpha="0.70" close="titleWindow_close(event)" xmlns:services="services.*">
          <fx:Declarations>
              <s:CallResponder id="getSpecificResultResult"/>
              <services:ExpertSearchManager id="expertSearchManager" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
          </fx:Declarations>
         
          <fx:Script>
              <![CDATA[
                  import mx.controls.Alert;
                  import mx.core.FlexGlobals;
                  import mx.events.CloseEvent;
                  import mx.events.FlexEvent;
                  import mx.managers.PopUpManager;
                 
                  [Bindable]

       

                  private function titleWindow_close(evt:CloseEvent):void {
                      PopUpManager.removePopUp(this)
                  }   
                 
                  protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
                  {
                      //change the below to dynamic 
                      var dataid:String;
                      dataid = FlexGlobals.topLevelApplication.id;
                      getSpecificResultResult.token = expertSearchManager.getSpecificResult(dataid);
                  }
                 
              ]]>
          </fx:Script>
         
          <mx:Image x="10" y="10" width="67" height="67"/>
          <s:Label x="85" y="10" text="Label" color="#FFFFFF"/>
          <s:Label x="125" y="10" text="Label" color="#FFFFFF"/>
          <s:Label x="85" y="30" text="Age" color="#FFFFFF"/>
          <s:Label x="114" y="30" text="Label" color="#FFFFFF"/>
          <mx:HRule x="0" y="109" width="697"/>
          <mx:HRule x="0" y="256" width="698"/>
          <mx:VRule x="256" y="114" height="141"/>
          <s:Label x="10" y="119" text="Social Network" color="#FFFFFF" fontWeight="bold" fontSize="14"/>
          <s:Label x="10" y="270" text="Relationship" color="#FFFFFF" fontWeight="bold" fontSize="14"/>
          <s:Label x="270" y="119" text="Skills" color="#FFFFFF" fontWeight="bold" fontSize="14"/>
          <mx:Image x="4" y="151" source="images/twitter.gif" width="85" height="21"/>
          <mx:Image x="6" y="199" source="images/facebook.jpg" width="85" height="21"/>
          <s:Label x="99" y="160" text="Label" color="#FFFFFF"/>
          <s:Label x="99" y="208" text="Label" color="#FFFFFF"/>
          <mx:DataGrid x="283" y="376" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getSpecificResultResult.lastResult}">
              <mx:columns>
                  <mx:DataGridColumn headerText="id" dataField="id"/>
                  <mx:DataGridColumn headerText="expert" dataField="expert"/>
                  <mx:DataGridColumn headerText="project" dataField="project"/>
                  <mx:DataGridColumn headerText="searchTerm" dataField="searchTerm"/>
                  <mx:DataGridColumn headerText="searchCriteria" dataField="searchCriteria"/>
                  <mx:DataGridColumn headerText="department" dataField="department"/>
                  <mx:DataGridColumn headerText="name" dataField="name"/>
                  <mx:DataGridColumn headerText="img" dataField="img"/>
              </mx:columns>
          </mx:DataGrid>

       

      </s:TitleWindow>

        • 1. Re: Retrieve data from datagrid
          BhaskerChari Level 4

          @YuHsin4221123,

           

          You can use selectedItem property of the dataGrid to retrieve the id..

           

          The code which you have written to retrieve the id..is not the id which you actually need but it is the id of the DataGrid

           

          private function onItemClick( e:ListEvent ):void {
                      //    currentState='SearchName';
                          //add popup here, then try to transfer a certain field to display all the required data
                      titleWindow = PopUpManager.createPopUp(this, component.DataDetail, true) as TitleWindow;
                      PopUpManager.bringToFront(titleWindow);
                      var dataid:String = dataGrid.selectedItem.id;
                      }

           

          Check the line in bold above...

           

           

          Thanks,

          Bhasker

          • 2. Re: Retrieve data from datagrid
            YuHsin4221123 Level 1

            Im encountering this problem. Access of undefined property dataGrid. 

             

            And how can i retrieve the value to my datadetail.mxml component. thank you so much for the help!

            • 3. Re: Retrieve data from datagrid
              BhaskerChari Level 4

              @YuHsin4221123,

               

              I am sorry I haven't observed keenly that your DataGrid is in your PopUp. Hence dataGrid is not accessible in your code and you will be shown an error.

               

              So you try the following...

               

               

              [Bindable]
                          public var dataid:String;
                          private function onItemClick( e:ListEvent ):void {
                          //    currentState='SearchName';
                              //add popup here, then try to transfer a certain field to display all the required data
                          titleWindow = PopUpManager.createPopUp(this, component.DataDetail, true) as TitleWindow;
                          PopUpManager.bringToFront(titleWindow);
                          var dataid:String = (e.currentTarget as DataGrid).selectedItem.id;
                          }

               

              Try this and let me know....

               

              Plese verify that you are getting e.currentTarget as a DataGrid See in the debug mode...

               

               

              Thanks,

              Bhasker

              • 4. Re: Retrieve data from datagrid
                YuHsin4221123 Level 1

                thanks for the reply. I'm not really sure how can i use the debug mode,but i tried running the application the datagrid in the popup is still unable to retrieve the id from my main application

                 

                currently i have a doubt. the code at datadetail.mxml

                 

                protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
                            {
                                //change the below to dynamic 
                                var dataid:String;
                                dataid = FlexGlobals.topLevelApplication.id;
                                getSpecificResultResult.token = expertSearchManager.getSpecificResult(dataid);
                            }

                 

                is this code the rigth way to retrieve my id?

                 

                i have some doubt in this line.                dataid = FlexGlobals.topLevelApplication.id;

                • 5. Re: Retrieve data from datagrid
                  YuHsin4221123 Level 1

                  i tried running on debug mode and added trace(dataid);

                   

                  and the console successfully display the id of the data i clicked. so i assumed that the problem lies with my datadetail. it couldn't retrieve my id from my main application.

                  • 6. Re: Retrieve data from datagrid
                    BhaskerChari Level 4

                    Hi

                     

                    dataid = FlexGlobals.topLevelApplication.id;

                    The above line of code is not the correct way of retrieving the id. Actually id is the value of the item you clicked in the DataGrid row right..

                     

                    Actually you said by using the below line of code which I posted in my porevious post is working then what else is the problem now..??

                     

                    var dataid:String = (e.currentTarget as DataGrid).selectedItem.id;

                     

                     

                    Thanks,

                    Bhasker

                    • 7. Re: Retrieve data from datagrid
                      YuHsin4221123 Level 1

                      The problem lies with this line of code. I need to retrieve the ID from the main application.

                      • 8. Re: Retrieve data from datagrid
                        BhaskerChari Level 4

                        Hi,

                         

                        Actually I don't understand your question correctly ..

                         

                        Ok Tell me onething you have your DataGrid and the onItemClick() function in the main application only right...

                         

                        If your onItemClick() function is within the main mxml file then and if you are getting the dataid using the below line of code in bold in itemClick() function then you are having the id in the main mxml file only right...then where and why do you want to access using FlexGlobals.topLevelApplication.id..??

                         

                         

                        Are you trying top access the id in another file other than main mxml file..??

                         

                        var dataid:String = (e.currentTarget as DataGrid).selectedItem.id;

                         

                         

                        Thanks,

                        Bhasker

                        • 9. Re: Retrieve data from datagrid
                          YuHsin4221123 Level 1

                          Hi,

                           

                          I sorry for the confusion caused. I am trying to display the ID in the popup component. Regarding the FlexGlobals.topLevelApplication.id..??, I am imsure about this, just randomly trying out it

                           

                          Yes, I am trying top accessing the id from another component, which is my popup component "datadetail.mxml"

                          • 10. Re: Retrieve data from datagrid
                            BhaskerChari Level 4

                            Hi YuHsin4221123,

                             

                            Hope you are getting the dataid in the onItemClick() function in ExpertDiscoverySystem.mxml(Main mxml file) using the below line of code..

                             

                            var dataid:String = (e.currentTarget as DataGrid).selectedItem.id;

                             

                            private function onItemClick( e:ListEvent ):void {
                                        //    currentState='SearchName';

                                          

                                        var dataid:String = (e.currentTarget as DataGrid).selectedItem.id;
                                        //add popup here, then try to transfer a certain field to display all the required data

                                        titleWindow._dataId = dataid;
                                        titleWindow = PopUpManager.createPopUp(this, component.DataDetail, true) as TitleWindow;
                                        PopUpManager.bringToFront(titleWindow);           
                                        }

                             

                             

                            So what you do here is create one public variable _dataId in popUp component -DataDetail.mxml- something as below...

                             

                            -DataDetail.mxml-

                             

                            public var _dataId:String;

                             

                            protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
                                        {
                                            //change the below to dynamic 
                                            var dataid:String;
                                            dataid = _dataId;
                                            getSpecificResultResult.token = expertSearchManager.getSpecificResult(dataid);
                                        }

                             

                            Observe the changes made in the code above in blue. Make these changes carefully and check. Please follow the same order the code in the onItemClick() function in ExpertDiscoverySystem.mxml(Main mxml file)

                             

                             

                            Thanks,

                            Bhasker

                             

                             

                            • 11. Re: Retrieve data from datagrid
                              YuHsin4221123 Level 1

                              Hi,

                               

                              I've followed your instruction, everything seems fine expect encountering this error at my Problem tag


                              1119: Access of possibly undefined property _dataid through a reference with static type mx.containers:TitleWindow.

                               

                              Thanks

                               

                              Let me just paste the full code here

                               

                              -ExpertDiscoverySystem.mxml-

                               

                              <?xml version="1.0" encoding="utf-8"?>
                              <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                             xmlns:s="library://ns.adobe.com/flex/spark"
                                             xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="1280" minHeight="960" xmlns:component="component.*" xmlns:services="services.*" currentState="SearchStart">
                                  <s:layout>
                                      <s:BasicLayout/>
                                  </s:layout>
                                  <fx:Style source="style/datagrid.css"/>
                                  <!--<fx:Style source="/style/style.css"/>-->
                                  <fx:Script>
                                      <![CDATA[
                                          import component.Window;
                                         
                                          import mx.containers.TitleWindow;
                                          import mx.controls.Alert;
                                          import mx.controls.dataGridClasses.DataGridColumn;
                                          import mx.events.FlexEvent;
                                          import mx.events.ListEvent;
                                          import mx.managers.PopUpManager;
                                          import mx.utils.object_proxy;
                                         
                                          import spark.layouts.RowAlign;

                               

                                     
                                          private var titleWindow:TitleWindow;
                                         
                                          /* Pop up for search again */
                                          
                                      /*     private function popUp():void {
                                          titleWindow = PopUpManager.createPopUp(this, component.Window, true) as TitleWindow;
                                          PopUpManager.bringToFront(titleWindow);} */
                                         
                                          protected function dgPeeps_creationCompleteHandler(event:FlexEvent):void
                                          {
                                              getContentForAllResult.token = expertSearchManager.getContentForAll();
                                          }   
                                         
                                          private function getResultName():void {
                                              if (searchNameText.text == ""){
                                                  Alert.show("You didn't enter any search term", "Error");
                                              }
                                              else{
                                                  currentState='SearchResult';
                                              }
                                          }
                                         
                                          private function getResultDomain():void {
                                              if (searchDomainText.text == ""){
                                                  Alert.show("You didn't enter any search term", "Error");
                                              }
                                              else{
                                                  currentState='SearchResult';
                                              }
                                          }
                                         
                                          private function onRefresh():void
                                          {
                                              var ref:URLRequest = new URLRequest("javascript:location.reload(true)");
                                              navigateToURL(ref,"_self");
                                          }
                                         
                                         
                                          private function onItemClick( e:ListEvent ):void {
                                          var dataid:String = (e.currentTarget as DataGrid).selectedItem.id;
                                          //add popup here, then try to transfer a certain field to display all the required data
                                          titleWindow._dataid = dataid;   
                                          titleWindow = PopUpManager.createPopUp(this, component.DataDetail, true) as TitleWindow;
                                          PopUpManager.bringToFront(titleWindow);
                                          //var dataid:String = (e.currentTarget as DataGrid).selectedItem.id;
                                          trace(dataid);
                                          //testPop();
                                          }
                                      ]]>
                                  </fx:Script>

                               

                                  <s:states>
                                      <s:State name="SearchName"/>
                                      <s:State name="SearchDomain"/>
                                      <s:State name="SearchResult"/>
                                      <s:State name="SearchStart"/>
                                  </s:states>
                                 
                                  <fx:Declarations>
                                      <s:CallResponder id="getContentForAllResult"/>
                                      <services:ExpertSearchManager id="expertSearchManager" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
                                 
                                  </fx:Declarations>
                                  <mx:Image x="0" y="0" includeIn="SearchDomain,SearchName,SearchStart" source.SearchName="images/background.jpg" source.SearchDomain="images/background.jpg" source.SearchStart="images/background.jpg"/>
                                  <s:Label x="411.05" y="455.05" text="a Domain" fontSize="36" includeIn="SearchDomain"/>
                                  <mx:LinkButton label="Name" fontSize="36" fontFamily="Verdana" includeIn="SearchStart" click="currentState='SearchName' " color="#CE1717" enabled="true" x="422.95" y="544.5" fontWeight="bold"/>
                                  <mx:LinkButton fontSize="36" fontFamily="Verdana" click="currentState='SearchDomain'" includeIn="SearchStart" color="#CC1C1C" label="Domain" x="695.95" y="543.5" fontWeight="bold"/>
                                  <mx:Image includeIn="SearchResult" x="0" y="0" source="images/backgroundsearch.jpg"/>
                                  <s:Button includeIn="SearchResult" x="1179" y="61.1" label="Search other" id="SearchAgainButton" color="#DD0A0A" click="onRefresh()"/>
                                  <!--<s:Button includeIn="SearchName" x="747" y="504" label="Search" id="searchNameButton" click="currentState='SearchResult'"/>-->
                                  <s:Button includeIn="SearchName" x="747" y="504" label="Search" id="searchNameButton" click="getResultName()"/>
                                  <s:TextInput includeIn="SearchName" x="164" y="504" width="561" id="searchNameText"/>
                                  <s:Button includeIn="SearchDomain" x="747" y="504" label="Search" id="searchDomainButton" click="getResultDomain()"/>
                                  <s:TextInput includeIn="SearchDomain" x="164" y="504" width="561" id="searchDomainText"/>

                               

                                  <s:Label includeIn="SearchResult" x="721" y="119" fontSize="25" id="SearchedTermLabel" text="{searchNameText.text}" fontWeight="bold" color="#D60D0D"/>
                                  <s:Label includeIn="SearchResult" x="725" y="119" fontSize="25" id="SearchedTermLabel2" text="{searchDomainText.text}" fontWeight="bold" color="#D80B0B"/>
                                  <s:Label includeIn="SearchResult" x="389" y="119" text="You've searched for the term:" fontSize="25" color="#FFFFFF"/>
                                  <s:Label includeIn="SearchName" x="411.05" y="455.05" text="a Name" fontSize="36"/>
                                  <mx:Panel width="1169" height="558" layout="absolute" title="Datagrid" x="48.7" y="171.65" includeIn="SearchResult">
                                      <mx:Label horizontalCenter="0" y="1" text="Results"
                                                fontSize="16" fontWeight="bold"/>
                                      <mx:DataGrid id="dgPeeps" width="1141" height="487" selectedIndex="0" showHeaders="false" x="16.6" y="24" creationComplete="dgPeeps_creationCompleteHandler(event)" itemClick="onItemClick(event);" dataProvider="{getContentForAllResult.lastResult}">
                                          <mx:columns>
                                              <mx:DataGridColumn dataField="img" itemRenderer="component.image"/>
                                              <mx:DataGridColumn headerText="name" dataField="name" />
                                              <mx:DataGridColumn headerText="department" dataField="department"/>
                                              <mx:DataGridColumn headerText="expert" dataField="expert"/>
                                              <mx:DataGridColumn headerText="project" dataField="project"/>
                                              <mx:DataGridColumn dataField="id"/>
                                          </mx:columns>
                                      </mx:DataGrid>
                                  </mx:Panel>
                              </s:Application>

                               

                              -datadetail.mxml-

                               

                              <?xml version="1.0" encoding="utf-8"?>
                              <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
                                       xmlns:s="library://ns.adobe.com/flex/spark"
                                       xmlns:mx="library://ns.adobe.com/flex/mx" width="700" height="600" backgroundColor="#000000" backgroundAlpha="0.70" close="titleWindow_close(event)" xmlns:services="services.*">
                                  <fx:Declarations>
                                      <s:CallResponder id="getSpecificResultResult"/>
                                      <services:ExpertSearchManager id="expertSearchManager" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
                                      <!-- Place non-visual elements (e.g., services, value objects) here -->
                                  </fx:Declarations>
                                 
                                  <fx:Script>
                                      <![CDATA[
                                          import mx.controls.Alert;
                                          import mx.core.FlexGlobals;
                                          import mx.events.CloseEvent;
                                          import mx.events.FlexEvent;
                                          import mx.managers.PopUpManager;

                               

                                          private function titleWindow_close(evt:CloseEvent):void {
                                              PopUpManager.removePopUp(this)
                                          } 

                               

                                          public var _dataId:String;
                                         
                                          protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
                                          {
                                              //change the below to dynamic 
                                              var dataid:String;
                                              dataid = _dataId;
                                              getSpecificResultResult.token = expertSearchManager.getSpecificResult(dataid);
                                          }
                                         
                                      ]]>
                                  </fx:Script>
                                 
                                  <mx:Image x="10" y="10" width="67" height="67"/>
                                  <s:Label x="85" y="10" text="Label" color="#FFFFFF"/>
                                  <s:Label x="125" y="10" text="Label" color="#FFFFFF"/>
                                  <s:Label x="85" y="30" text="Age" color="#FFFFFF"/>
                                  <s:Label x="114" y="30" text="Label" color="#FFFFFF"/>
                                  <mx:HRule x="0" y="109" width="697"/>
                                  <mx:HRule x="0" y="256" width="698"/>
                                  <mx:VRule x="256" y="114" height="141"/>
                                  <s:Label x="10" y="119" text="Social Network" color="#FFFFFF" fontWeight="bold" fontSize="14"/>
                                  <s:Label x="10" y="270" text="Relationship" color="#FFFFFF" fontWeight="bold" fontSize="14"/>
                                  <s:Label x="270" y="119" text="Skills" color="#FFFFFF" fontWeight="bold" fontSize="14"/>
                                  <mx:Image x="4" y="151" source="images/twitter.gif" width="85" height="21"/>
                                  <mx:Image x="6" y="199" source="images/facebook.jpg" width="85" height="21"/>
                                  <s:Label x="99" y="160" text="Label" color="#FFFFFF"/>
                                  <s:Label x="99" y="208" text="Label" color="#FFFFFF"/>
                                  <mx:DataGrid x="90" y="315" id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{getSpecificResultResult.lastResult}" width="542" height="96">
                                      <mx:columns>
                                          <mx:DataGridColumn headerText="id" dataField="id"/>
                                          <mx:DataGridColumn headerText="expert" dataField="expert"/>
                                          <mx:DataGridColumn headerText="project" dataField="project"/>
                                          <mx:DataGridColumn headerText="searchTerm" dataField="searchTerm"/>
                                          <mx:DataGridColumn headerText="searchCriteria" dataField="searchCriteria"/>
                                          <mx:DataGridColumn headerText="department" dataField="department"/>
                                          <mx:DataGridColumn headerText="name" dataField="name"/>
                                          <mx:DataGridColumn headerText="img" dataField="img"/>
                                      </mx:columns>
                                  </mx:DataGrid>

                               

                              </s:TitleWindow>

                              • 12. Re: Retrieve data from datagrid
                                BhaskerChari Level 4

                                Hi ,

                                 

                                Instead of declaring your titleWindow as of type TitleWindow, try to decalre it as of type component.DataDetail which is your popup component so that you can get rid of that error.

                                 

                                So your declaration should look like as below:

                                 

                                Include the import statment for component.DataDetail;

                                 

                                import component.DataDetail;

                                 

                                private var titleWindow:DataDetail;

                                 

                                Now in onClick utem you should have something like below..

                                 

                                private function onItemClick( e:ListEvent ):void {
                                            var dataid:String = (e.currentTarget as DataGrid).selectedItem.id;
                                            //add popup here, then try to transfer a certain field to display all the required data
                                            titleWindow._dataid = dataid;   
                                            titleWindow = PopUpManager.createPopUp(this, component.DataDetail, true) as DataDetail;
                                            PopUpManager.bringToFront(titleWindow);
                                            //var dataid:String = (e.currentTarget as DataGrid).selectedItem.id;
                                            trace(dataid);
                                            //testPop();
                                            }

                                 

                                Observe the changes in Blue.

                                 

                                Thanks,

                                Bhasker

                                • 13. Re: Retrieve data from datagrid
                                  YuHsin4221123 Level 1

                                  I did what as told. Still experiencing the same problem


                                  1119: Access of possibly undefined property _dataid through a reference with static type component:DataDetail.    ExpertDiscoverySystem.mxml

                                  • 14. Re: Retrieve data from datagrid
                                    BhaskerChari Level 4

                                    It should work correctly if you have made the changes correctly. You will be directly shown the property _dataid which you type titleWindow. through code intellisense.

                                     

                                    As since you have declared a public variable it should defenitely be accessible for titleWindow instance. Please crosscheck you aren't doing anything wrong.

                                     

                                     

                                     

                                    Thanks,

                                    Bhasker

                                    • 15. Re: Retrieve data from datagrid
                                      YuHsin4221123 Level 1

                                      Hi,

                                       

                                      Right now, everything seems to be fine at the problem tag, I've tried running the application, but after I clicked data on the datagrid, as error prompt out

                                       

                                      TypeError: Error #1009: Cannot access a property or method of a null object reference.
                                          at ExpertDiscoverySystem/onItemClick()[C:\Documents and Settings\L30912\Desktop\SampleWorkSpace\MOSM\src\ExpertDiscoverySystem.mxml:66]
                                          at ExpertDiscoverySystem/__dgPeeps_itemClick()[C:\Documents and Settings\L30912\Desktop\SampleWorkSpace\MOSM\src\ExpertDiscoverySystem.mxml:110]
                                          at flash.events::EventDispatcher/dispatchEventFunction()
                                          at flash.events::EventDispatcher/dispatchEvent()
                                          at mx.core::UIComponent/dispatchEvent()[E:\dev\4.x\frameworks\projects\framework\src\mx\core \UIComponent.as:12528]
                                          at mx.controls.listClasses::ListBase/mouseClickHandler()[E:\dev\4.x\frameworks\projects\fram ework\src\mx\controls\listClasses\ListBase.as:10319]

                                       

                                      I did debugging, id was able to retrieve.

                                       

                                      Thank you for the help. So much appreciated

                                      • 16. Re: Retrieve data from datagrid
                                        YuHsin4221123 Level 1

                                        I realize the error

                                         

                                        titleWindow._dataId = dataid; was place on top of titleWindow = PopUpManager.createPopUp(this, component.DataDetail, true) as DataDetail;

                                         

                                        that it couldn't find titleWindow

                                         

                                        Thank you so much. Everything was working fine now.

                                         

                                        I got one side track question to ask. If it's convience for you to answer. Because currently I'm using a BlazeDS to provide the data for my flex application. So right now I am able to get the id, it allows me to display the entire data of one specific id.

                                         

                                        is there a way to integrate the data into label, img? but not datagrid?

                                        • 17. Re: Retrieve data from datagrid
                                          BhaskerChari Level 4

                                          Hi,

                                           

                                          I din't understand your question ...Is there a way to integrate the data into label, img? but not datagrid?

                                           

                                          Will you please elaborate..??

                                           

                                          Thanks,

                                          Bhasker

                                          • 18. Re: Retrieve data from datagrid
                                            YuHsin4221123 Level 1

                                            Sorry for causing so many misunderstand and for the late reply.

                                             

                                            Okay thing goes like this.

                                             

                                            1) Since now the problem in this thread had solved. I will be able to retrieve all the information of the data from a specific id.

                                            2) But I wanted my data to display on img, txt component instead of datagrid component.

                                             

                                            Currently these data are able to display on my datagrid easily with the help of BlazeDS.

                                             

                                            But I've totally no idea how i can make the data display on the img and txt component.

                                            • 19. Re: Retrieve data from datagrid
                                              YuHsin4221123 Level 1

                                              somebody help please. thanks