on 06-21-2010 3:52 PM
Hello,
I am creating a table (lr_table) dynamically using the CL_WD_DYNAMIC_TOOL=>CREATE_TABLE_FROM_NODE function. This is working fine and the table is populated accordingly.
However, I need the first column of the table to be a radio button, so, I get the column (lr_column) with the lr_table->GET_COLUMN function, create a radio button instance, lr_button, and use the function lr_column->SET_TABLE_CELL_EDITOR( lr_button ). The bindings and value sets are all working.
The problem is that when I do this, the table switches the column order. The first column, wich has the radio button, is shown in second place.
Has anyone come across a similar problem?!
I've searched the foruns but couldn't fine an aswer...
Thanks in advance.
Hi, I did in fact resolve this issue using lr_column->set_fixed_position( CL_WD_ABSTR_TABLE_COLUMN=>E_FIXED_POSITION-LEFT ).
Although this is not listed as a method of the CL_WD_TABLE_COLUMN type, it actually worked.
Still no idea of why this happened, I create three tables inside a loop clause, from three context nodes with exactly the same structure and only in the first one I got this "bug"!
Thx for the support,
Gonçalo Nolasco
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sounds like the change of the editor is removing and adding the column to the table.
As there is no "set column order" method, I'd suggest firstly getting all the columns from your table using
table->get_columns
then altering the the column you want - as you have, and then removing all the columns using
table->remove_all_columns
and then finally re-adding them in the order you want them displayed
table->add_column.
Hope this helps,
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chris,
A small correction to what you had quoted. We do have the method set_position available for changing the order of an ALV column.
Regards,
Uday
You can use the below code snippet to change the position of the column SEATCOSS from the existing position to 3.
DATA: lr_column TYPE REF TO cl_salv_wd_column,
lo_value TYPE REF TO cl_salv_wd_config_table,
l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
* Get config model
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
lo_value = l_ref_interfacecontroller->get_model( ).
lr_column = lo_value->if_salv_wd_column_settings~get_column(id = SEATSOCC').
DATA: ls_column TYPE salv_wd_s_column_ref.
ls_column-r_column = lr_column.
ls_column-r_column->set_position( 3 ).
Hi Chris,
Sorry it was a slip from my end. Guess I need to read the threads a bit more carefully... But I do however have a workaround even for this!
You can set the "fixedPosition" property for the desired column to "left" to have it as the 1st column of your table. But you need to keep 1 thing in mind... If you have another column within the table having its "fixedPosition" property set to "left" then this would influence the final output. Say your table has col1, col2, col3 & col4. You have set the "fixedPosition" property to left for col2 & col4 then the final table output would be: col2, col4, col1, col3
Regards,
Uday
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.