2 Replies Latest reply on Apr 1, 2009 6:41 AM by MM4D

    Best way to tackle project.

      Hi.

      I'm just after a bit of advice on the best way to do a project I'm working on.

      Firstly I'm new to Flex and just learning and also my programming skills are fairly low.

      What I'm wanting to do is to create a simple application that features a combobox and a datagrid.

      The combobox pulls a list of names from a MS SQL database, through a PHP page. That I can do, no problem.

      When a user selects a name from the list the datagrid is then populated with a list of modules asscociated with the selected name. I have tried to do this with one PHP query, but have ended up with the combobox being populated with multiple names relating to each module in the DB, so if this is the best way to continue, how would I specify distinct values in the Flex app for the combobox?

      Or is it possible, or better, to link two PHP queries to the app, then have the datagrid filtered on whatever name is selected from the combobox? Any tips, ideas, or links on how to do this?

      Any help or advice will be greatly apprecaited.

      Thanks.
        • 1. Re: Best way to tackle project.
          matthew horn Level 3
          I like to keep it simple, so I would do two separate queries, one on startup to populate the combobox, and then the second one triggered off the combobox's change event that gets the details for the datagrid.

          Assuming we're not talking about a crazy amount of data in the datagrid, the lag will not be very noticeable to users when they are waiting for the DG to be populated from a server request.

          matt horn
          flex docs
          • 2. Re: Best way to tackle project.
            Level 1
            Thanks for that Matt. I haven't had much luck in getting it to work with multiple queries and passing items back to PHP to query the DB as a where clause.

            I did come across this
            http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postI d=11846

            And i have found I could get this to work to create a datagrid with a combobox filter on each column.

            However the comboboxes are populated from an array in the app, not sure if this is a very efficient way to do it as the some lists can be nearly 200 long.

            What I'm after doing now is to have the comboboxes, filter depending on what is shown in the other boxes. So the columns are a "group code" [cbIL], "Org Code" [cbTC], "Org Name" [cbDP], and "Module" [cmMD]. Each Group Code can have several Organisations assigned to it, but an Org is only in one group. Each Org has multiple modules assigned to it.

            What I have found with the way I have done this so far is that You can filter by Org Name, but are then able to select any of the other Org Codes. It would be good say if you select a Group Code, only the Org Codes and Org Names that are assigned to that group will then be visible in the other comboboxes.

            Is this going to be easily done with what I have done so far?

            Am I really heading in the wrong direction with this?

            Can anyone recommend any online resources to help me with the live query route?