cancel
Showing results for 
Search instead for 
Did you mean: 

Webynpro Table Filter

former_member187452
Contributor
0 Kudos

Hi All,

I have used Table UI element and have used Filter to the Table.

The Filter functionality is working fine.

In my Table the First record is always selected. So when I apply filter and i get the results of the filter in that no row is selected.

I want to make First row of the Filtered result as selected. Can you please let me know how make the First record of the filter result as selected.

Also I want to read the filter results in the modifyview method. How to read the filtered results.

Thanks,

Bharat

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Bharat,

To mark first line of filtered result, write the below logic in FILTER action handler method.


  data lt_data TYPE WDR_TABLE_ROW_DATA_TAB.

  data ls_data like LINE OF lt_data.

  data lo_node TYPE REF TO if_wd_context_node.

 

  " Get data of filtered result

  lt_data = wd_this->table_method_hndl->get_table_data( ).

  LOOP AT lt_data INTO ls_data.

    IF sy-tabix = 1. " for first line

      " Get context node of filter line

      lo_node = ls_data-context_element->get_node( ).

        IF lo_node is BOUND." Mark first line

          lo_node->set_lead_selection_index( 1 ).

        ENDIF.

    ENDIF.

    exit." exit loop

  ENDLOOP.

Similarly, to get fitler result ....

lt_data = wd_this->table_method_hndl->get_table_data( ).

Hope this resolves your issue.

Regards,

Rama

former_member187452
Contributor
0 Kudos

thanks for the reply.

It worked.

Answers (0)