3 Replies Latest reply on Sep 17, 2009 11:15 AM by Ansury

    Design question in Flex.

    karnatis Level 1

      Hi All,

       

         Say I'm having two tabs in main Menu. One tab is HOME and another one is SEARCH.

       

         In Home tab it will dispaly following DataGrid

       

         Empno   EmpName DeptNo

        -----------   ---------------  ----------

         1000       aaa          Computers

         1001       bbb          Computers

         1003       ccc          Accounting

         1004       ddd          HR

       

       

        In Search, it will have combo box which will display distinct Departments names, it will have Computers,Accounting,HR etc.

       

        When user selects say 'Computers' it will display below DataGrid.

       

         Empno   EmpName DeptNo

        -----------   ---------------  ----------

         1000       aaa          Computers

         1001       bbb          Computers

       

       

        Now what I want is, all these DataGrids user can select Empno(hyper link) to display employee details...Can someone please let me know how to do this? whether we need to add employee details in each page(Home,Search) or we can create new page for employee details and can we invoke this page when user selects employee number(hyper link).

       

        If you have any samples regarding this then please provide me.

       

        Thanks in advance.

       

      Regards,

      Sharath.

        • 1. Re: Design question in Flex.
          Ansury Level 3

          You could also use a popup dialog like this:

           

          http://blog.flexexamples.com/2007/08/20/creating-custom-dialog-boxes-using-the-popupmanage r-and-titlewindow-classes/

           

          I would create a TitleWindow in mxml though, don't use that first silly example they have, use the later one:

           

           

          private var titleWindow:TitleWindow;
          
          private function popUp():void {
              titleWindow = PopUpManager.createPopUp(this, CustomTitleWindow, true) as TitleWindow;
              PopUpManager.centerPopUp(titleWindow);
          }
          • 2. Re: Design question in Flex.
            karnatis Level 1

            Didn't want to use pop-ups, so how to accomplish this...

             

            Thanks,

            Sharath.

            • 3. Re: Design question in Flex.
              Ansury Level 3

              Maybe I'm totally missing the point of what you're asking for but if this is a design question, it's really up to your sponsor/customer ultimately if you're unsure and don't want to use a popup window.

               

              If you have plenty of extra space on your UI, it might make sense to just display the information on both pages individually without switching to another (it's more convenient IMO, IF it all fits).  And you can make it kinda fancy looking with some transition effects or whatever.  If you do this, create a separate mxml file and re-use it (don't just put duplicate display code in both views) as a component within both views.  There's a bunch of ways you can do this but pass the relevant data to your employee detail display component just like any other mxml component using setters.  That could even be the trigger if you set the component's visible property to true when the DataGrid's selectedItem property is not null.

               

              If you don't have room to spare you pretty much have to make it a separate page, but the principles are the same.