Form: TAB_CANVAS使用总结

1. 建立Window,canvas,block为order,其canvas为Conent Canvas
2. 建立TAB_CANVAS为LINE_CHOICE,并带有3个Tab pages分别为:  LINE_ORDER,LINE_DATE,LINE_QTY
3. 建立CANVAS_STACKED_FIXED_FIELD为LINE_FIXED,并把需要固定的项如 CURRENT_RECORD_INDICATOR,  ITEM,Scroll Bar显示在此画布上
4. 建立CANVAS_STACKED为LINE_ORDER,LINE_DATE,LINE_QTY,并把相应数据项分别置于各自的画布  其中LINE_ORDER为现实第一堆叠画面,Visible为Yes,LINE_DATE和LINE_QTY其Visible为No
5. 以上所有的画布其Window为:order,建立按以上顺序建立,并按以上顺序堆叠,其大小顺序为
   order>LINE_CHOICE>LINE_FIXED>LINE_ORDER=LINE_DATE=LINE_QTY
6. 从服务器上下载FND_TOP/resource文件FNDTABS.txt or FNDTABFF.txt
7. 修改文件FNDTABFF.txt,在program Units建立MY_TAB包
8. 在WHEN-TAB-PAGE-CHANGED,WHEN-NEW-ITEM-INSTANCE,KEY-CLRFRM调用此包MY_TAB.tab_entity_regions

PACKAGE MY_TAB IS
  PROCEDURE tab_entity_regions(event VARCHAR2);
END;

PACKAGE BODY MY_TAB IS
  PROCEDURE tab_entity_regions(event VARCHAR2) IS

  /* --------------------------------------------------------------------
   $Header: fndtabff.txt 115.2.1150.2 2000/02/21 14:45:16 pkm ship $
   +======================================================================+
   | Copyright (c) 1999 Oracle Corporation Redwood Shores, California, USA|
   |                       All rights reserved.                           |
   +======================================================================+
    This is a template of the control procedure for Tab Regions.  Import
    into your form. program unit (package) and MODIFY as appropriate for
    YOUR form, canvas, block, item, and other names.  Be sure to call your
    handler from the appropriate triggers.

    This template handles the more complex case where you have a multi-row
    tab region with one or more fixed fields (such as current record
    indicators, block scrollbars and other fixed fields), which appear on a
    stacked canvas, and one or more sets of fields that appear on additional
    stacked canvases. 

    Names of corresponding stacked canvases and tab pages must match.

    Modify the following variables/names (in order of appearance):
     tab_entity_regions           -- name of the procedure
     TAB_ENTITY_REGIONS           -- name of the entire tab canvas
     MY_BLOCKNAME                 -- name of the block
     MY_FIRST_ALT_REG_CANVAS      -- name of first stacked canvas containing
                                     "alternative" (non-fixed) fields
     TAB_ENTITY_REGIONS_FIXED     -- name of stacked canvas containing fixed fields
     FIRST_ALT_REG_FIRST_FIELD    -- name of first (enterable/queryable) field on
                                     first "alternative" (non-fixed) stacked canvas
     MY_SECOND_ALT_REG_CANVAS     -- name of second stacked canvas containing
                                     non-fixed fields
     SECOND_ALT_REG_FIRST_FIELD   -- name of first (enterable/queryable) field on
                                     second "alternative" (non-fixed) stacked canvas
     MY_THIRD_ALT_REG_CANVAS      -- name of third stacked canvas containing
                                     non-fixed fields
     THIRD_ALT_REG_FIRST_FIELD    -- name of first (enterable/queryable) field on
                                     third "alternative" (non-fixed) stacked canvas
    
   ----------------------------------------------------------------------
  */
 
  /*-------------------------------------------------------+
   | Tab Handler for one set of Alternative Regions (Tabs).|
   | Called from form-level WHEN-TAB-PAGE-CHANGED and      |
   | block-level WHEN-NEW-ITEM-INSTANCE triggers (passing  |
   | EVENT)                                                |
   +-------------------------------------------------------*/
  target_canvas_name VARCHAR2(30) := name_in('system.tab_new_page');
  curr_canvas_name   VARCHAR2(30) := get_item_property(
                                               name_in('system.cursor_item'),
                                               item_canvas);
  current_tab        VARCHAR2(30) := get_canvas_property('HEADER_CHOICE',
                                                         topmost_tab_page);

  BEGIN
  
    IF (event = 'WHEN-TAB-PAGE-CHANGED') THEN
        
              ---------ORDER LINES
        
          if name_in('system.cursor_block') = 'ORDER_LINES_V' then
           --
           -- Process the 'First' tab specially. if the cursor is already
           -- on a field on the 'Fixed' canvas then we merely show the other
           -- stacked canvas; otherwise, we move the cursor to the first
           -- item on it.
           --
           if target_canvas_name =  'LINE_ORDER' then
             if curr_canvas_name = 'LINE_FIXED' then
               show_view(target_canvas_name);
               go_item(name_in('system.cursor_item'));
                               -- move focus off the tab itself
             else
               validate(item_scope);
               if not form_success then
                 --
                 -- Revert tab to prior value and exit
                 --
                 set_canvas_property('LINE_CHOICE', topmost_tab_page,
                                     name_in('system.tab_previous_page'));
                 return;
               end if;
               show_view('LINE_ORDER');
                         -- display first stacked canvas
               go_item('ORDER_LINES_V.ITEM_DESC');
                       -- go to first item on that stacked canvas
             end if;
           else
             validate(item_scope);
             if not form_success then
               --
               -- Revert tab to prior value and exit
               --
               set_canvas_property('LINES_CHOICE', topmost_tab_page,
                                   name_in('system.tab_previous_page'));
               return;
             end if;
             --
             -- Move to first item on each additional (non-first) tab
             --
             if target_canvas_name = 'LINE_DATE' then
               go_item('ORDER_LINES_V.CREATION_DATE');
             elsif target_canvas_name = 'LINE_QTY' then
               go_item('ORDER_LINES_V.ORDERED_QUANTITY');
             end if;
           end if;
         else
           show_view(target_canvas_name);
         end if;


    ELSIF (event = 'WHEN-NEW-ITEM-INSTANCE') THEN

       if ((curr_canvas_name in ('HEADER_ORDER',
                                 'HEADER_CUSTOMER')) and
           (curr_canvas_name != current_tab)) then
            set_canvas_property('HEADER_CHOICE', topmost_tab_page,
                              curr_canvas_name);
       end if;
      
        if ((curr_canvas_name in ('LINE_ORDER',
                                 'LINE_DATE','LINE_QTY')) and
           (curr_canvas_name != current_tab)) then
            set_canvas_property('LINE_CHOICE', topmost_tab_page,
                              curr_canvas_name);
       end if;

    ELSE
      app_exception.invalid_argument('ORDER_LINES_V.LINE_CHOICE',
                                     'EVENT', event);
    END IF;

  END tab_entity_regions;

END;
 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/41594/viewspace-410076/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/41594/viewspace-410076/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值