• CRM WEB UI 04明细界面添加按钮


    好了,这个是个人测试玩的,略风骚。。。请自行鉴阅

    1.明细的组件控制器中增加全局控制属性字段:

    2.概览页中工具栏相关方法,重定义GET_BUTTONS

      METHOD IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS.
        DATA:LV_LOCK   TYPE ABAP_BOOL VALUE ABAP_TRUE,
             LV_ENABLE TYPE ABAP_BOOL VALUE ABAP_FALSE.
        DATA:LR_COM   TYPE REF TO ZL_ZLYTEST0_BSPWDCOMPONE3_IMPL.
        DATA:RW_BUTTON TYPE CRMT_THTMLB_BUTTON_EXT.
    
    
        CALL METHOD SUPER->IF_BSP_WD_TOOLBAR_CALLBACK~GET_BUTTONS
          RECEIVING
            RT_BUTTONS = RT_BUTTONS.
    
        LR_COM ?= ME->COMP_CONTROLLER.
        CHECK LR_COM IS BOUND.
        IF LR_COM->DISPLAY = ABAP_TRUE.
          LV_ENABLE = ABAP_FALSE.
        ELSE.
          LV_ENABLE = ABAP_TRUE.
        ENDIF.
    
    
        RW_BUTTON-TYPE = CL_THTMLB_UTIL=>GC_ICON_SAVE.
        RW_BUTTON-ON_CLICK = 'SAVE'.
        RW_BUTTON-PAGE_ID = ME->COMPONENT_ID.
        RW_BUTTON-ENABLED = LV_ENABLE.
        APPEND RW_BUTTON TO RT_BUTTONS.
    
        RW_BUTTON-TYPE = CL_THTMLB_UTIL=>GC_ICON_CANCEL.
        RW_BUTTON-ON_CLICK = 'CANCEL'.
        RW_BUTTON-PAGE_ID = ME->COMPONENT_ID.
        RW_BUTTON-ENABLED = LV_ENABLE.
        APPEND RW_BUTTON TO RT_BUTTONS.
    
      ENDMETHOD.

    3.概览页中工具栏相关方法,重定义GET_NUMBER_OF_VISIBLE_BUTTONS

      METHOD IF_BSP_WD_TOOLBAR_CALLBACK~GET_NUMBER_OF_VISIBLE_BUTTONS.
        RV_RESULT = 9.
      ENDMETHOD.

    4.DETAIL视图的实现类中定义属性:

    5.DETAIL视图中,重定义DO_PREPARE_OUTPUT

        DATA:LS_BUTTON TYPE CRMT_THTMLB_BUTTON.
        CALL METHOD SUPER->DO_PREPARE_OUTPUT.
    
        REFRESH GT_BUTTON.
        CLEAR:LS_BUTTON.
        LS_BUTTON-TYPE = CL_THTMLB_UTIL=>GC_ICON_EDIT.
        LS_BUTTON-TEXT = CL_WD_UTILITIES=>GET_OTR_TEXT_BY_ALIAS( 'CRM_UIU_BU/EDIT' ).
        LS_BUTTON-ENABLED = ABAP_TRUE."此处可酌情控制
        LS_BUTTON-ON_CLICK = 'EDIT'.
        APPEND LS_BUTTON TO GT_BUTTON.
      ENDMETHOD.

    6.修改DETAIL的htm页面:用本地的变量控制配置页

    <%@page language="abap" %>
    <%@extension name="thtmlb" prefix="thtmlb" %>
    <%@extension name="chtmlb" prefix="chtmlb" %>
    <%@extension name="bsp" prefix="bsp" %>
    <%
    data:LV_XML type STRING,
         LV_DISPLAYMODE type STRING.
         LV_DISPLAYMODE = CONTROLLER->VIEW_GROUP_CONTEXT->IS_VIEW_IN_DISPLAY_MODE( CONTROLLER ).
         %>
         <thtmlb:areaFrameSetter toolbarButtons = "<%= controller->gt_button %>"
                                 maxButtonNumber = "4"
                                 displayMode     = "<%= lv_displayMode %>"
                                 />
    <chtmlb:config mode = "RUNTIME"
                   displayMode  = "<%= CONTROLLER->VIEW_DISPLAY %>" />

     7.创建DETAIL的事件处理器EDIT

      METHOD EH_ONEDIT.
        DATA:LR_COM   TYPE REF TO ZL_ZLYTEST0_BSPWDCOMPONE3_IMPL.
    
    
        LR_COM ?= ME->COMP_CONTROLLER.
    
        CHECK LR_COM IS BOUND.
    
        IF LR_COM->DISPLAY = ABAP_TRUE.
          LR_COM->DISPLAY = ABAP_FALSE.
          VIEW_DISPLAY = ABAP_FALSE.
        ELSE.
          LR_COM->DISPLAY = ABAP_TRUE.
          VIEW_DISPLAY = ABAP_TRUE.
        ENDIF.
    
      ENDMETHOD.

    OK了

  • 相关阅读:
    P2480 [SDOI2010]古代猪文(CRT+Lucas+费马小定理)
    P2473 [SCOI2008]奖励关(状压+期望dp)
    P2485 [SDOI2011]计算器(快速幂+扩欧+bsgs)
    板子
    https://lydsy.download/archive/
    [SDOI2010]地精部落(dp)
    P2446 [SDOI2010]大陆争霸(有限制的最短路)
    博客园在页面内设置超链接
    Matlab 绘制双纵轴图
    Matlab画图线型、符号及颜色汇总
  • 原文地址:https://www.cnblogs.com/sapSB/p/6340916.html
Copyright © 2020-2023  润新知