2 Replies Latest reply on May 23, 2008 5:21 AM by EvolvedDSM

    Need advice on application layout

    EvolvedDSM Level 2
      Some background info on the project. My application will be using a single database table as it's data source, using Flex Data Services 2. This table contains problem tickets that my users have given me. The table contains a "status" column, which holds an 'open' or closed' value to denote the current status of the problem ticket, as well as a date column to signify when the ticket was submitted.

      I need to make an application that will show three different views of the same table: the current day's open tickets, the current day's closed tickets, and a history of all tickets. I also need to include a form where I can input tickets.
      Here's an example I made in a few seconds of what I am thinking it would look like:

      This is where I need advising. Since all three datagrids will be using the same data source, but will require a different filterFunction on the dataprovider, is it better to separate each tab into a component where I can create a single dataprovider with filterFunction for each grid, or keep it all within the main application? If I separate them, how can I make sure each grid will properly update when I add a new ticket, or change the status of a ticket?

      Also, does anyone else have a better suggestion for my design?
        • 1. Re: Need advice on application layout
          ntsiii Level 3
          If you bind you controls to the data model(s), and use the dataProvider AIP to update the data, then the UI/data synchronization will happen automatically.

          The filter function makes a copy of the data, leaving the base model alone.

          Components are usually easier to maintain.

          • 2. Re: Need advice on application layout
            EvolvedDSM Level 2
            ntsiii can you elaborate on what an AIP is? Maybe I'm already using it and just don't know what it is?

            I was planning on declaring a dataservice with an arrayCollection of the data to populate the grids (i'm using CF as my backend). To create new records I was going to use a ds.createItem(item) statement. Updating the records would be done through the datagrid edit property.

            One question: If I'm creating separate components and declaring the same DS and AC in each component but with different filters on the AC, will the DGs update properly while the filter is on it? Or is there something I need to do, like an addEventListener to get all the data to update properly?