2 Replies Latest reply on Nov 17, 2008 6:11 AM by Newsgroup_User

    passing data from component

    phil1943 Level 1
      I have a main application, with a custom VBox component, which then holds a nested Form component.
      So three layers deep in total.
      Upon form submit, what is the best way to get the data from the form component(third layer) back up to the main app (first layer) ?

      eg.
      -create a custom event and pass the textInput fields
      - directly reference the Form's textInput fields from main app.
      - create a click event listener in the main app to the VBox, and somehow access the textInput fields ?
      - another method ?

      Thanks for any advice.
        • 1. Re: passing data from component
          John Hall Level 4
          IMHO, number two is out. You probably don't want to 'hard-wire' a direct reference to the form from the main app. 1 and 3 are probably part of the same solution, which is to dispatch a custom event that is handled either by the main app (if it's a small application) or a separate manager or controller class that is listening for such events.
          • 2. Re: passing data from component
            Level 7

            "phil1943" <webforumsuser@macromedia.com> wrote in message
            news:gfr76k$hai$1@forums.macromedia.com...
            >I have a custom VBox component withing my main app. Within that custom VBox
            >is
            > a form component.
            > Upon form submit, what is the best way to get the data from the form
            > component
            > back up to the main app ?
            >
            > eg.
            > -create a custom event
            > - directly reference the Form's textInput fields from main app.
            > - create a click event listener in the main app, and somehow access the
            > textInput fields ?
            >
            > Thanks for any advice.

            Look at Q3 in the FAQ, which I just posted for this week.