3 Replies Latest reply: Oct 14, 2010 1:57 PM by Andreas Weiden RSS

    trigger when navigating away from a tab page

    user574499
      We have oracle forms 10g. The form I have inherited has 6 tabs. I would like to trigger a call to a program unit when the user leaves a particular tab.

      We already have a trigger for when-tab-page-changed, but the tab page used in there seems to be the tab page I have navigated to. I want to trigger off the one I am leaving.

      Any input would be greatly appreciated.

      Thank you.
        • 1. Re: trigger when navigating away from a tab page
          CraigB
          Unfortunately, there is no "Post-Tabpage-Changed" trigger. However, if the data displayed in your tab pages is organized by block - in that the data displayed in each tab page has its own unique data block and items in a blocks are not displayed on more than one tab page - then you could use the Block level "Post-Block" trigger to emulate a "Post-Tabpage-Changed" type of event you are looking for. The Post-Block trigger fires as focus moves off the current block so if you have one data block per tab page - changing tab pages would cause this trigger to fire.

          Hope this helps,
          Craig B-)

          If someone's response is helpful or correct, please mark it accordingly.
          • 2. Re: trigger when navigating away from a tab page
            ZA
            You can set a control item or global variable to hold default tab page LABEL in WHEN-NEW-FORM-INSTANCE and when focus moves to current tab, you read the global variable and reset it to current tab page label in the WHEN-TAB-PAGE-CHANGE trigger.

            You'll need to initialize the global variable in WHEN-NEW-FORM-INSTANCE for default tab like below:

            :GLOBAL.CURR_TAB := 'TabA';
            Example WHEN-TAB-PAGE-CHANGED:
            DECLARE  
              tp_nm   VARCHAR2(30);
              tp_id   TAB_PAGE;
              tp_lb   VARCHAR2(30);
              prev_tab VARCHAR2(30) := :GLOBAL.CURR_TAB;
            BEGIN  
              tp_nm := GET_CANVAS_PROPERTY('canvas3', topmost_tab_page);
              tp_id := FIND_TAB_PAGE(tp_nm);
              tp_lb := GET_TAB_PAGE_PROPERTY(tp_id, label);
            
              :GLOBAL.CURR_TAB := tp_lb;
            
              MESSAGE('Previous Tab: '||prev_tab||' Current Tab: '||:GLOBAL.CURR_TAB);
              MESSAGE('Previous Tab: '||prev_tab||' Current Tab: '||:GLOBAL.CURR_TAB);
              
              IF prev_tab = 'TabA' THEN
                <your code in case previous tab was TabA>
              ELSIF prev_tab = 'TabB' THEN
                <your code in case previious tab was TabB>
              END IF;
            
            END;
            Hope it helps!

            Edited by: Zaafran Ahmed on Oct 13, 2010 4:50 PM

            Edited by: Zaafran Ahmed on Oct 14, 2010 8:37 AM
            • 3. Re: trigger when navigating away from a tab page
              Andreas Weiden
              There is a system-variable you can check in the WHEN-TAB-PAGE-CHANGED-trigger to get the previous tab-page.
              IF :SYSTEM.TAB_PREVIOUS_PAGE='YOUR_PAGE' THEN
              ..