首页 > 解决方案 > 无法选择表格视图中的行

问题描述

我有一个包含一些数据的表格视图。我在 PopUp 中使用它来选择行,但是每次当我单击某行时,它都集中在第一行而不改变。我该如何解决这个问题?我的意思是,当我点击某行时,焦点应该在我选择的行上。

这是我的代码.htm

<%@page language="abap" %>
<%@extension name="thtmlb" prefix="thtmlb" %>
<%@extension name="chtmlb" prefix="chtmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<%
* Conversion Cnode SelectionMode to Tag
  data: lv_cellerator_selectionmode   type string,
        lv_cellerator_editmode        type string,
        lv_cellerator_selectioncolumn type string.
  cl_thtmlb_util=>translate_selection_mode(
    exporting
      iv_selection_mode    = CAMPTYPE->SELECTION_MODE
      iv_all_rows_editable = space
    importing
      ev_selection_mode    = lv_cellerator_selectionmode
      ev_edit_mode         = lv_cellerator_editmode
      ev_selection_column  = lv_cellerator_selectioncolumn ).
%>
<chtmlb:configCellerator downloadToExcel       = "FALSE"
                         editMode              = "NONE"
                         id                    = "ConfCellTable"
                         onRowSelection        = "select"
                         personalizable        = "FALSE"
                         selectedRowIndex      = "<%= CAMPTYPE->SELECTED_INDEX %>"
                         selectedRowIndexTable = "<%= CAMPTYPE->SELECTION_TAB %>"
                         selectionColumn       = "<%= lv_cellerator_selectioncolumn %>"
                         selectionMode         = "<%= lv_cellerator_selectionmode %>"
<%--                         selectionMode         = "SINGLE"--%>
                         table                 = "//CAMPTYPE/Table"
                         usage                 = "EDITLIST"
                         visibleFirstRow       = "<%= CAMPTYPE->VISIBLE_FIRST_ROW_INDEX %>"
                         visibleRowCount       = "10"
                         width                 = "100%"
                         xml                   = "<%= controller->configuration_descr->get_config_data( ) %>" />

标签: abapsap-crmsap-bsp

解决方案


<%@page language="abap" %>
<%@extension name="thtmlb" prefix="thtmlb" %>
<%@extension name="chtmlb" prefix="chtmlb" %>
<%@extension name="bsp" prefix="bsp" %>
<%
* Conversion Cnode SelectionMode to Tag
  data: lv_cellerator_selectionmode type string,
        lv_cellerator_editmode  type string,
        lv_cellerator_selectioncolumn type string.

 cl_thtmlb_util=>translate_selection_mode(
  exporting
    iv_selection_mode    = CAMPTYPE->SELECTION_MODE
    iv_all_rows_editable = space
  importing
    ev_selection_mode   = lv_cellerator_selectionmode
    ev_edit_mode        = lv_cellerator_editmode
    ev_selection_column = lv_cellerator_selectioncolumn ).

    DATA: lv_excel          TYPE string.
    lv_excel       = abap_false.

<chtmlb:configCellerator downloadToExcel       = "<%= lv_excel %>"
                         editMode              = "NONE"
                         id                    = "ConfCellTable"
                         onRowSelection        = "select"
                         personalizable        = "FALSE"
                         selectedRowIndexTable = "<%= CAMPTYPE->SELECTION_TAB %>"
                         selectionColumn       = "<%= lv_cellerator_selectioncolumn %>"
                         selectionMode         = "SINGLE"
                         table                 = "//CAMPTYPE/Table"
                         usage                 = "ASSIGNMENTBLOCK"
                         visibleRowCount       = "10"
                         width                 = "100%"
                         xml                   = "<%= controller->configuration_descr->get_config_data( ) %>" />

推荐阅读