on 01-25-2006 11:22 AM
Hi,
I would like to know that how to implement the Sorting Option in WebDynPro UI Table Element . A code snippet will help on the same issue .
Regards
Sid
Hi Siddarth,
1. You need to assign an action (e.g. 'DO_SORT') to the UI table you want to sort.
2. Within the action 'DO_SORT' you have to get the context node of your table, the column and the current sort direction.
lr_node = wd_context->get_child_node( <table_context_node> ).
l_col_name = wdevent->get_string( 'COLUMN' ).
l_sort_direction = wdevent->get_string( 'DIRECTION' ).
3. Get the context value table
lr_node->get_static_attributes_table( IMPORTING table = <value_table> )
4. Now do the sorting of the context node depending on the sort direction and bind it back to the context node.
CASE l_sort_direction.
WHEN CL_WD_TABLE_COLUMN=>E_SORT_STATE-UP. " Ascending
SORT <value_table> ASCENDING BY (l_col_name).
WHEN CL_WD_TABLE_COLUMN=>E_SORT_STATE-DOWN. " Descending
SORT <value_table> DESCENDING BY (l_col_name).
ENDCASE.
lr_node->bind_table( <value_table> ).
That's it
Regards,
Ralf
Message was edited by: Armin Reichert
Points assigned
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ralf ,
Thanks a lot for the code snippet .
It is really helpful and it is working properly .
Thanks and Regards
Sid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.