webdynpro 下拉列表控件

  1. 如今界面上添加下拉列表的控件DropDownByKey
  2. 在context中建立新的node,和屬性DP
  3. 返回界面,綁定DP到控件DropDownByKey的SelectedKey

初始方法中代碼以下:node

*下拉菜單
  DATA lo_nd_drop TYPE REF TO if_wd_context_node.
  DATA lo_el_drop TYPE REF TO if_wd_context_element.
  DATA ls_drop TYPE wd_this->Element_drop.

  data lo_nd_if_drop TYPE REF TO IF_WD_CONTEXT_NODE_INFO.
  data lt_value_set TYPE TABLE OF WDR_CONTEXT_ATTR_VALUE.
  data ls_value_set type WDR_CONTEXT_ATTR_VALUE.
  lo_nd_drop = wd_context->get_child_node( name = wd_this->wdctx_drop ).
  CALL METHOD LO_ND_DROP->GET_NODE_INFO
    RECEIVING
      NODE_INFO = lo_nd_if_drop.

ls_value_set-value = '1'.
ls_value_set-text = '江蘇'.
append ls_value_set to lt_value_set.

ls_value_set-value = '2'.
ls_value_set-text = '上海'.
append ls_value_set to lt_value_set.

  CALL METHOD LO_ND_IF_DROP->SET_ATTRIBUTE_VALUE_SET
    EXPORTING
      NAME      = 'DP'
      VALUE_SET = lt_value_set

預覽:app

相關文章
相關標籤/搜索