on 01-09-2007 5:26 PM
Hi,
I've created an ALV with a column with checkboxes.
The problem is:
It's possible to make editable only some checkboxes cells of the column?
I've used the SALV_WD_TABLE component.
The code where i created the column with checkboxes is (in the WDDOINIT method of the VIEW):
...
instancing check box
data: lr_checkbox type ref to cl_salv_wd_uie_checkbox.
create object lr_checkbox
exporting
checked_fieldname = 'CHECK'.
lr_checkbox->set_read_only( value = abap_false ).
lr_column = l_value->if_salv_wd_column_settings~get_column( 'CHECK' ).
lr_column->set_cell_editor( lr_checkbox ).
...
Thanks for answers.
Hi Avalor,
Yes its possible to make only some of the checkbox cells editable.
Follow the steps.
1. Create a additional field of type boolean in the source context node. Set default value as abap_true.
2. In instantiating the check box, set the read only field to the created boolean field name.
instancing check box
data: lr_checkbox type ref to cl_salv_wd_uie_checkbox.
create object lr_checkbox
exporting
checked_fieldname = 'CHECK'.
lr_checkbox->SET_READ_ONLY_FIELDNAME('FIELDNAME1').
lr_column = l_value->if_salv_wd_column_settings~get_column( 'CHECK' ).
lr_column->set_cell_editor( lr_checkbox ).
3. Delete the column of the boolean field, so that it ll not be visible.
DATA: l_ref_interfacecontroller TYPE REF TO IWCI_SALV_WD_TABLE .
l_ref_interfacecontroller = wd_This->wd_CpIfc_Alv( ).
data: l_value type ref to Cl_Salv_Wd_Config_Table.
l_value = l_ref_interfacecontroller->Get_Model().
delete column
l_value->if_salv_wd_column_settings~delete_column( 'FIELDNAME1' ).
4. Change the context boolean element of the context node to disable the checkbox of a particular row.
Hope it helps
Regards,
Rakesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is certainly close to the solution.
My system is down for backup so I cant check code.
Essentially when you which to change the properties of a cell not an entire column,
then you do via a helper field in the table, which is set in each row for the table for the column
in question.
ie TABLE ROWS contain
field1, field2, etc, CHECK_BOX_FIELD, Checkbox_readonly_state
From memory it is the cell editor used in the column that is used to point the property at the extra field not the column object itself. I didnt check which object, you should check that.
However, I hope in principal you have the approach.
regards
Phil.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.