Skip to Content
avatar image
Former Member

regarding selection of row?

Hi All,

I have a table in my view.

i want to select the entire row when i click anywhere on the table.

i am using

event_element = wdevent->get_context_element( 'CONTEXT_ELEMENT' ) to get the particular row.but i am getting ' Access via 'NULL' object reference not possible'.

Could anyone pls give me the exact code ..how to proceed for this? where shall i write the code in select event handler or onleadselection event handler method?

Regards,

Lakshmi.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 30, 2008 at 11:56 AM

    Hi,

    DATA:lv_outputelement TYPE REF TO if_wd_view_element,

    lr_table TYPE REF TO cl_wd_table,

    lt_el_userenty TYPE wdr_context_element_set,

    lt_el_user TYPE wdr_context_element_set.

    DATA lo_nd_userenty TYPE REF TO if_wd_context_node.

    DATA lo_el_userenty TYPE REF TO if_wd_context_element.

    DATA ls_userenty TYPE wd_this->element_userenty.

    DATA lo_el_user TYPE REF TO if_wd_context_element.

    clear lt_el_user[].

    CASE iv_ui_element_name.

    WHEN 'TABLE'.

    • navigate from <CONTEXT> to <USERENTY> via lead selection

    lo_nd_userenty = wd_context->get_child_node( name = wd_this->wdctx_userenty ).

    CALL METHOD lo_nd_userenty->get_elements

    RECEIVING

    set = lt_el_userenty.

    lt_el_user = lt_el_userenty.

    endcase.

    LOOP AT lt_el_user INTO lo_el_user.

    CALL METHOD lo_el_user->set_selected

    EXPORTING

    flag = abap_true.

    ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 30, 2008 at 06:51 AM

    Hi Lakshmi,

    Use Lead selection Event of table to get the selected row information.

    Write the below code to get the selected row data..

    method onactionselect .
      data:
        node_sflight   type ref to if_wd_context_node,
        elem_sflight   type ref to if_wd_context_element,
        stru_sflight   type if_main=>element_sflight .
    * navigate from <CONTEXT> to <SFLIGHT> via lead selection
      node_sflight = wd_context->get_child_node( name = if_main=>wdctx_sflight ).
    
    * get element via lead selection
      elem_sflight = node_sflight->get_element(  ).
    
    * get all declared attributes
      elem_sflight->get_static_attributes(
        importing
          static_attributes = stru_sflight ).
    endmethod.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      actually i wanted to keep the row as selected when i click on anywhere on the table row .i do not want particular row data .

      Regards,

      Lakshmi.

      Edited by: Lakshmi Atukury on Sep 30, 2008 1:47 PM