0 Replies Latest reply on Mar 28, 2010 8:03 PM by nHero2

    FB4: Master-Detail Form

    nHero2

      Samples will show how to generate a Master-Detail form (in the same state) and that works pretty well, provided that Master & Detail are on the same page/state.

       

      Separating the Master (datagrid) and Detail (form) by putting them in two different states does not work as well.

      Pseudo-code Example:

       

      <fx:Declarations>

      <s:CallResponder...> ... <valueObjects:MyDataType id="myDataType"/>

      </fx:Declarations>

       

      <fx:Binding source="masterDG.selectedItem as MyDataType" destination="myDataType"/>

      <mx:DataGrid id="masterDG" includeIn="FirstState" itemClick="currentState='SecondState';" ... />

      <mx:Form id="DetailForm" includeIn="SecondState" ... />

       

      This is what happens...

      DataGrid is populated, and an item is clicked, so the SecondState is show.

      The detail-form is not populated - it's just blank.

      I go back to the FirstState where the clicked item is now blank.

      I click another item in the DataGrid.

      Now the detail-form is populated properly.

       

      Question: How can I initiate the DataGrid in the "Master Form" so that the "Detail Form" will be populated when clicking the first time?