树控件的双击事件分配树对象的时候报错
abap吧
全部回复
仅看楼主
level 1
当我在构建树子程序的最后一行写下set handler g_application->handle_dbclick for wa_tree. 程序报错为:
when specification a handler for an event in the set handler statement,the reference 'g_application ' to the handler instance cannot be null.
2018年11月07日 07点11分 1
level 1
注:g_application为之前定义的局部类声明的引用,代码如下
class cl_event_handle DEFINITION.
PUBLIC SECTION.
methods handle_dbclick
for event node_double_click
of cl_gui_simple_tree
importing node_key.
endclass.
class cl_event_handle IMPLEMENTATION.
method handle_dbclick.
nodekey = node_key.
READ TABLE node_table with key node_key = node_key
into node1.
nodetext = node1-text.
ENDMETHOD.
endclass.
data g_application type REF TO cl_event_handle.
2018年11月07日 07点11分 2
level 1
还是个学生,网上找的PDF照着敲下来的,纳闷的是我昨天成功了,今天学了点对节点的修改之后程序报错我就把今天的代码都删掉了,结果反而双击的都弄不了了,求大神解答啊。
2018年11月07日 07点11分 3
level 1
新弄个程序成功了,但我把之前的类和事件注册那几行代码复制到之前那个程序依然报错,然后我尝试复制整个代码在重新弄了一遍屏幕依然报错,好吧,我放弃了。
2018年11月08日 15点11分 4
1