2 Replies Latest reply on Mar 10, 2010 7:01 AM by Francisc

    What is the best practice to pass data between parent and\or between it's components?

    megharajdeepak Level 1

      Hello,

       

      I would like to know what is the conventional way of passing data from a parent to it's child components.

      Ex:

       

      <Application>

           <ChildComponent1 id="cc1"/>

       

           <ChildComponent2 id="cc2"/>

       

           <ChildComponent3 id="cc3"/>

       

      </Application>

       

      If I want to pass data from parent application to ChildComponent1, I can use cc1.textInputField1.text = "someValue";

       

      I can also define a custom event in the parent application under Metadatatag and dispatch this event along with all the data that I want to pass on, to cc1, which listens to this event in it's creationComplete function and assign the passed values.

       

      Please let me know if there are some other ways too, apart from these And also let me know which one should be followed as a standard.

       

      Thank you,

      -Deepak