• Form 电子表格(JTF GRID)


    JTF GRID 的简单概念
    JTF Grid不是Form 的标准功能,而是 Oracle自己在 EBS 开发中总结出来的“可配置块字段”:块中有多少字段可以通过专门的界面定义。
     
    对于开发来说,要做的事情就是用“遵循 JTF Grid规范”换取“增删字段无需修改 Form代码”。
     
    测试:
    1.引用JTF Grid的PLL库
    选中 Attached Libraries ,点击“+ ”,选择 JTF_GRID.pll,其将自动引用 JTF_UTIL JTFDEBUG 。如果本地没有请先从服务器下载
     
    2.拷贝标准 JTF Grid对象
     
    1.1 对象组
    打开 JTFSTAND.fmb,把对象组“JTF_GRID”拖到我们自己的 Form中,并选择“Subclass”而非“ Copy”,这个和前面讲的Folder一样。
     
    这样会自动产生一系列用于 JTF_GRID的对象:块、画布、参数、 Property ClassesWindow ,尤其注意 Form级触发器JTF_GRID_EVENT 。这些都不用修改。
     
    1.2 过程
    JTFSTAND.fmb拷贝 JTF_CUSTOM_GRID_EVENT过程到我们自己的Form中,然后补上事件处理,暂时全部放 null
     
    PROCEDURE jtf_custom_grid_event(gridname  IN VARCHAR2
                                   ,eventtype IN VARCHAR2 ) IS
        grid_selection jtf_grid_property.row_selection_type;
        l_start_row    NUMBER;
    BEGIN
        IF eventtype = jtf_grid_events.hyperlink_event THEN
            NULL;
        ELSIF eventtype = jtf_grid_events.new_record_event THEN
            NULL;
        ELSIF eventtype = jtf_grid_events.popup_event THEN
            NULL;
        ELSIF eventtype = jtf_grid_events.row_selection_event THEN
            NULL;
        ELSIF eventtype = jtf_grid_events.end_of_find_event THEN
            NULL;
        ELSIF eventtype = jtf_grid_events.doubleclick_event THEN
            NULL;
        END IF ;
    END;
     
    3.创建数据库对象
     
    -- Create table
    CREATE TABLE cux_test_jtf_grid 
    AS 
    SELECT line_num
          ,vendor_name
          ,vendor_id
          ,order_date
          ,po_number
          ,inventory_item_id
          ,item_number
          ,DESCRIPTION
          ,quantity
          ,unit_of_measure
          ,unit_price
          ,currency_code 
    FROM  xxibi_rcv_att_ohhand_v ;
    
    --Or Create table
    create table CUX_TEST_JTF_GRID
    (
      LINE_NUM          NUMBER not null,
      VENDOR_NAME       VARCHAR2(240),
      VENDOR_ID         NUMBER,
      ORDER_DATE        DATE,
      PO_NUMBER         VARCHAR2(20) not null,
      INVENTORY_ITEM_ID NUMBER not null,
      ITEM_NUMBER       VARCHAR2(40),
      DESCRIPTION       VARCHAR2(240),
      QUANTITY          NUMBER not null,
      UNIT_OF_MEASURE   VARCHAR2(25) not null,
      UNIT_PRICE        NUMBER,
      CURRENCY_CODE     VARCHAR2(15)
    )
     
     
    4.定义 CRM 电子表格
    路径:

     输入电子表格名称、源视图、字段定义

     
    5.创建GRID块
     
    手工创建非数据库块,规范起见,块名后加“GRID”,这里是“DEMO_GRID”。
     
    当然了,从 Template开始的常规修改步骤也是要做的。
     
    6.修改GRID块
     
    添加三个ITEM
     
    Bean Area :READONLY_GRID
     
    Button :FIND
    Button :DETAIL
     
     
    7.布局ITEM到画布
     
    对于Bean Area 只能在其属性上设置其在画布上的显示宽度和高度
     
    8.添加触发器代码
     
    Form 级别 WHEN-NEW-FORM-INSTANCE
     
    IF NOT jtf_grid.getbooleanproperty('DEMO_GRID.READONLY_GRID',
                                       jtf_grid_property.initialized) THEN
       jtf_grid.init('DEMO_GRID.READONLY_GRID','CUX_TEST_JTF_GRID_V');
       jtf_grid.setbooleanproperty('DEMO_GRID.READONLY_GRID',
                                   jtf_grid_property.allow_multiple_row_selection,
                                   FALSE);
    END IF ;
     
    用户点击 Find,通常是弹出查询界面,输入完条件再执行查询,我们这里省去查询条件界面
    Find 按钮 WHEN-BUTTON-PRESSED
     
    jtf_grid.removeallbindvariables( 'DEMO_GRID.READONLY_GRID');
     
    jtf_grid.setcharproperty('DEMO_GRID.READONLY_GRID'
                            ,jtf_grid_property.where_clause
                            ,'CURRENCY_CODE = ''USD''');
     
    IF jtf_grid.getbooleanproperty('DEMO_GRID.READONLY_GRID'
                                  ,jtf_grid_property.is_populated) THEN
        jtf_grid.refresh('DEMO_GRID.READONLY_GRID');
    ELSE
        jtf_grid.populate('DEMO_GRID.READONLY_GRID');
    END IF ;
     
    9.处理选择事件
    用户选中某行后,我们可以根据其选中的信息去打开一个普通块,这样首先需要在 FIND按钮的WHEN-BUTTON-PRESSED 中编写
    jtf_grid.requestrowselection('DEMO_GRID.READONLY_GRID');
     
    可以打开该包查看其具体作用。然后在过程 jtf_custom_grid_event中响应选择事件
     
    PROCEDURE JTF_CUSTOM_GRID_EVENT(gridName in varchar2, eventType in varchar2) IS
      grid_selection JTF_GRID_PROPERTY.ROW_SELECTION_TYPE;
      l_start_row  number;
    BEGIN
      IF eventtype = jtf_grid_events.hyperlink_event THEN
        null;
      ELSIF eventtype = jtf_grid_events.new_record_event THEN
        null;
      ELSIF eventtype = jtf_grid_events.popup_event THEN
        null;
      ELSIF eventtype = jtf_grid_events.row_selection_event THEN
        grid_selection := jtf_grid.getRowSelection('DMEO_GRID.READONLY_GRID' );
        if grid_selection.COUNT > 0 then
          l_start_row := grid_selection(1).startrow;
          --fnd_message.debug(jtf_grid.getcolumncharvalue('DMEO_GRID.READONLY_GRID',l_start_row,'NAME'));
        end if ;
      ELSIF eventtype = jtf_grid_events.end_of_find_event THEN
        null;
      ELSIF eventtype = jtf_grid_events.doubleclick_event THEN
        null;
      END IF;
    END;
     
    10.上传编译
     
  • 相关阅读:
    网络科学导论【第二章】读书脑图
    稳定匹配
    Machine learning(3-Linear Algebra Review )
    Machine learning(2-Linear regression with one variable )
    Machine learning(1-Introduction)
    1710. Maximum Units on a Truck (E)
    0729. My Calendar I (M)
    0105. Construct Binary Tree from Preorder and Inorder Traversal (M)
    0746. Min Cost Climbing Stairs (E)
    0128. Longest Consecutive Sequence (M)
  • 原文地址:https://www.cnblogs.com/objmodel/p/7655377.html
Copyright © 2020-2023  润新知