cancel
Showing results for 
Search instead for 
Did you mean: 

Enable filtering on dynamically created table/columns

markus_reich
Participant
0 Kudos

Hi Community,

I have a table with columns which are created in method WDDOMODIFYVIEW, the table itself is in the layout, but without any columns.

Now I want to add the standard filtering possibility, for this I created an FILTER action and bound it to the table onFilter event.

In the UI now a new additionally row is rendererd, but it's not possible to set a filter value, as the cells are not enabled?

Do I miss sthg.?

Coding for a column, may I have to set another attribute too?

lo_dropdown = cl_wd_dropdown_by_key=>new_dropdown_by_key( id = lv_id

                                                     bind_selected_key = 'INTERNAL_CHANNEL.POSTING_COUNTRY'

                                                     view = view

                                                     on_select = 'DROPDOWN'

                                                     activate_access_key = 'X'

                                                     bind_read_only = 'INTERNAL_CHANNEL.READ_DROPDOWN').

lo_table_column->set_header( lo_caption ).

lo_table_column->set_table_cell_editor( lo_dropdown ).

lo_table_column->set_width( '10ex' ).

lo_table->add_column( lo_table_column ).

regards

Markus

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

When we create a filter statically, we bind the filterValue property of TableColumn.

This property must be bound dynamically as well.

markus_reich
Participant
0 Kudos

sorry, I forgot to mention, that I tried this too 😞

lo_table_column->set_filter_value( value = 'INTERNAL_CHANNEL.POSTING_COUNTRY').

...has no effect, the main problem is that the row is not enabled

regards

Meex

Former Member
0 Kudos

This should work.

However i see that you are using the same attribute for binding filterValue and the tableColumn.

For filter, you need to create an extra node (1:1) just for the the top filter row. The attribute from this node has to be bound to filterValue property.

markus_reich
Participant
0 Kudos

ok, found the solution, thanx

with set_filter_value method you can only bind static values, if you want to bind to context nodes/attributes you have to do this in the constructor of table column

lo_table_column = cl_wd_table_column=>new_table_column(

     id = lv_id

     bind_filter_value = 'INTERNAL_FILTER.POSTING_COUNTRY'

     view = view ).

Markus

Former Member
0 Kudos

Yeah. You are correct.

There is one more method bind_filter_value to bind it to an attribute if you do not want to do that in the constructor of table column.

Answers (0)