on 04-11-2017 4:10 PM
Hi Team,
We have Table ui element with 6 columns, out of these 1 column has Check-boxes.
Whenever the user clicks on the check box in that line line then one particular cell alone should become read-only.
We tried, with Toggle action in the check-box and below is the code written, but unfortunately the read only property is never sets. Please let me know your thoughts on this.
we used the same approach which has been discussed in the SDN document. but for us it is not working.
DATA lo_node TYPE REF TO if_wd_context_node.
DATA lt_elements TYPE wdr_context_element_set.
DATA ls_elements LIKE LINE OF lt_elements.
DATA lt_attr_names TYPE string_table.
DATA lv_attr_name LIKE LINE OF lt_attr_names.
DATA ls_data TYPE wd_this->element_mother_coil.
FIELD-SYMBOLS: <fs_value> TYPE any.
lo_node = wd_context->get_child_node( name = wd_this->wdctx_mother_coil ).
lt_elements = lo_node->get_elements( ).
lt_attr_names = lo_node->get_node_info( )->get_attribute_names( ).
LOOP AT lt_elements INTO ls_elements.
ls_elements->get_static_attributes( IMPORTING static_attributes = ls_data ).
IF ls_data-complete_consuption IS NOT INITIAL.
LOOP AT lt_attr_names INTO lv_attr_name WHERE table_line = 'CONSUPTION_QUANTITY'.
ls_elements->set_attribute_property(
EXPORTING
attribute_name = 'CONSUPTION_QUANTITY'
property = ls_elements->e_property-read_only
value = abap_true ).
ENDLOOP.
ENDIF.
ENDLOOP.
Thanks Deepak,
Yes the binding was missing, now it is working as expected
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Bala,
Check the Binding properties of Checkbox.
I hope you assigned appropriate binding attribute to READ-ONLY field.
The data element for read only field is WDY_BOOLEAN with values
X -True
space- False
So u can directly read that line item set value as 'X' to it
node-attrb-field = 'X'.
Thanks ,
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.