1 Reply Latest reply on Jun 19, 2008 8:21 AM by TransoniqHacker

    Perform a query on tree node click

    TransoniqHacker Level 1
      This is probably very easy and I'm just having brain freeze..

      I have an application that is using ColdFusion to provide data for various controls. One control is a tree showing two levels of data (main level shows the process/job number, then you open that to see all the event numbers for that job). This all works fine.

      Now what I want to do is when you select an even number, flex will use a coldfusion page I set up to perform a query on the database using the event number and job number to get all the rest of the data about htat particular job (description, run times, etc)

      I have the click event from the tree control working fine, I have the page in coldfusion working fine, it outputs an XML format file with all the relevant details based on the parameters you send it. Now the question is, how do I populate the fields on the form with the data returned from the query?

      I am using a HTTPService call to get the data to/from ColdFusion (I have version 6.1 of Coldfusion).

      Thanks for any help.
        • 1. Re: Perform a query on tree node click
          TransoniqHacker Level 1
          Well, I answered my own question... Here is what I did in case anyone else wants to know. If there is a better way, please advise.

          I have a click event on the tree control. Since the tree will only be two levels deep (parent and child) I test for whether the item clicked has a parent. If it does, I know they clicked on a child node. I then fire off the HTTPService with the parameters from the child and parent nodes of the tree item that was clicked.

          In the result parameter of the HTTPService, I populate the various fields using the lastresult.root.fieldname syntax of the HTTPService.

          It works as expected, but perhaps there is a better way?