Skip navigation
marshom
Currently Being Moderated

problem Module/datagrid, one time with data, one time is null

Jun 12, 2013 2:32 PM

Tags: #moduleloader #datagrid #selecteditems #doubleclick

Hello All

thanks for this discussion place, i have a problem in Flash Builder 4.6 (sdk 4.6.0), construct an application who connect to DB, for now, the CRUD works fine with flex service,

i have a problem with a datagrid, one time it's worked fine, and another time my obj is null, i cannot understand why.. the fact it's work one time trouble me.. and i have no error in console..

the target, is to edit a row of datagrid in popup, it's work as you stay in the ModuleClient, but when i launch another Module and come back to ModuleClient, the edit datagrid doesn't work anymore

 

i try to put the process here, as the app is large: (say to me if you want more code, i will try to isolate some pieces)

debug-datagrid.jpg

- click in ModuleMenu and load ModuleClient in ModuleContent

- dataGrid populate with ArrayCollection

- double click row in dataGrid (dataGrid_doubleClickHandler(event:MouseEvent))

- dataGridClients.selectedItem contains effective data

- push data to ValueObject (ClientObj) already defined in flex services/connected to DB

          var ClientDataGrid:ClientObj = dataGridClients.selectedItem as ClientObj;

- push data ClientDataGrid to Popup

          in Popup: <valueObjects:ClientObj id="clientObj"/>

- works fine

 

if i select another Module in ModuleMenu, and later relaunch ModuleClient

 

- dataGrid populate with ArrayCollection

- double click row in dataGrid

- dataGridClients.selectedItem contains effective data

- push data to ValueObject (ClientObj) already defined in flex services/connected to DB

          var ClientDataGrid:ClientObj = dataGridClients.selectedItem as ClientObj;

- ClientDataGrid is null

- cannot push data ClientDataGrid to Popup as ClientDataGrid is null

- doesn’t work

 

 

<s:DataGrid id="dataGridClients" left="0" right="230" top="66" bottom="10"

creationComplete="dataGrid_creationCompleteHandler(event)"

dataProvider="{clientListeSimpleResult.lastResult}"

doubleClick="dataGrid_doubleClickHandler(event)" doubleClickEnabled="true"

alternatingRowColors="[#FFFFFF, #f4f3f2]">

 

 

Thanks in advance for any advices/ideas

i think i make misunderstood of something, im not a flex/flash as3 coder

so any help would be greatly appreciated

best regards anyway

 
Replies
  • Currently Being Moderated
    Jun 12, 2013 9:24 PM   in reply to marshom

    There's a modules presentation on my blog (blogs.adobe.com/aharui).  It explains more on how modules work, especially that they are factories, not instances.  So often you load a module once in an app, then create multiple instances from the module's factory.

     

    HTH,

    -Alex

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points