4 Replies Latest reply: May 8, 2012 6:28 AM by Chris Muir-Oracle RSS

    how to handle tab change event in UI shell main area

    904000
      Hi,

      I have two tabs(two taskflows) in UI shell main area. one is department tab and another is employee tab. My department tab shows employees department wise. On employee tab I have emplyee table which shows employees jobwise. This employee table has the functionality of adding new record to employee vo as well.

      Now i follow these steps.
      1. by defualt department tab is open.
      2. by clickinng on Tasks menu link i open Employee tab in to main area. Now i have both tabs in main area.
      3. at Employee tab I search all employees job = accountant. It shows the search result well.
      4. Now i add a new record to it and without saving/deleting this record i move to department tab.
      5. at Department tab i search employees where department =20, here no relation b/w job and department.
      6. Now i return to employee tab. my newly added record got disappeared. It is there but does not show in table.

      How to resolve it??
      I have one solution in my mind while changing the tab i can prompt to user "you can not leave the newly added record..either save it or delete it". But how to catch tab change event here? where i can write code to prompt msg to user?

      Pls help.

      Edited by: 900997 on May 6, 2012 4:10 AM
        • 1. Re: how to handle tab change event in UI shell main area
          Chris Muir-Oracle
          When you say:

          "2. by clickinng on Tasks menu link i open Employee tab in to main area. Now i have both tabs in main area."

          ....does this mean you have 2 pages that you're switching between, both using the ADF UI Shell, or, you have a single page with 2 dynamic tabs open within that single page?

          CM.
          • 2. Re: how to handle tab change event in UI shell main area
            904000
            yes you are right, there are two pages. two taskflows basically.

            Regards,
            Manu
            • 3. Re: how to handle tab change event in UI shell main area
              904000
              Chris,

              Could you tell me how to handle event on tab click and how can i execute a code on this event?

              Regards,
              Manu
              • 4. Re: how to handle tab change event in UI shell main area
                Chris Muir-Oracle
                With apologies for the slow reply, I'm currently travelling.

                Two things to note:

                1) The af:document uncommittedDataWarning flag was designed to stop users navigating away from half entered records. More about this flag can be found here:
                http://docs.oracle.com/cd/E23943_01/web.1111/b31973/af_orgpage.htm#CACDDDFH (see point 4)
                http://www.oracle.com/technetwork/developer-tools/adf/unsaveddatawarning-096556.html

                ....please note our documentation from time to time spells this flag wrong with only one "t" in the word committed, so if you're attempting a bulk search check for this (and I'll raise document bugs to get this fixed in the future).

                2) On addressing the ADF UI Shell, if you're switching between "pages" in the UI Shell, as separate to switching between dynamic tabs within a single page using the UI Shell, the UI Shell will actually restart the currently running task flow in the page you're returning too. You can verify this by implementing an initializer on your task flow with a log message, and watching when the initializer is called.

                In addressing your last question, at this stage I think you need to assess my first answer then come back if you think you sill need to execute the code on the tab click. I also need to know are you talking about the primary level of tabs that represent each page in the UI Shell, or are you referring to the dynamic tabs within a single UI Shell page that hold your task flows?

                CM.