1 Reply Latest reply on Jan 9, 2007 8:47 AM by dimival

    Passing data to parent components

      Howdy folks,

      I'm basically attempting to pass data between components. Passing data from a parent component to a child component is easy enough but I have run into a few problems with attempting the opposite.

      Goal :-
      In more detail, I have the parent component which contains an accordian. Each accordian pane is a component within itself. The first accordian pane is a search component that users can search for a customer's site address and make a selection from a data grid. When a user selects a customer from the grid, I wish to pass the Site ID of that selection to the second accordian pane to display that sites full details.

      Problem :-
      The way in which I have attempted to do this is by passing the selection (the site ID) to a bindable variable (called SiteID) in the parent component which contains the accordian (using parent.SiteID = event.currentTarget.selectedItem.SiteID) to then pass it to the second accordian pane where the site's details can be displayed but I get an "Undefined property" error.

      I believe a way to do this is by using a custom event for the search component but I am hoping there is a more straight forward way to do this.

      Any help would be greatly appreciated.

      Many thanks.
        • 1. Re: Passing data to parent components
          dimival Level 1
          I think events are the best approach to your problem, you could also use the parent or parentApplication properties to acces the parent component. I think you can use Application.application and that one references your parent application too.
          I will insist that using events is the best solution, but feel free to try the other solutions

          Hope it helps u out