on 11-17-2007 1:44 AM
Hi Expert,
I am trying to hide some input field from the view under certain conditions. Here is my code.
data: lr_input type ref to cl_wd_input_field.
if not stru_prod1-objek1 is initial.
lr_input ?= view->get_element( 'DESC1_1' ).
lr_input->set_visible( visibility = 'visible' ).
endif.
Here is the error message:
Formal parameter "VISIBILITY" does not exist. exist.
Can anyone tell me what wrong with my code?
Thanks,
ATANG
Welcome to SDN.
You can hide with below code:
lr_input->set_visible( CL_WD_UIELEMENT=>e_visible-NONE ).
Raja T
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andy,
Make use of This example which is used to hide an input field
DATA:
name_ip TYPE REF TO cl_wd_input_field.
name_ip ?= view->get_element( 'NAME').
" NAME is the name of input field in my view
CALL METHOD name_ip->set_visible
EXPORTING
value = abap_false
.
Regards
Sarath
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sarath,
Here is the error message when call method is used in my abap code.
"ABAP-FALSE" is not type-compatible with formal parameter "VALUE".
Here is my code:
data: lr_dropdown type ref to cl_wd_dropdown_by_key.
lr_dropdown ?= view->get_element( 'OBJEK1' ).
CALL METHOD lr_dropdown->set_visible
EXPORTING
value = abap_false.
Thanks
Hi Andy,
Another way of doing this is the following:
Define a context attribute (or node of cardinality 0..1 with a context attribute) say INPUT_VIS. In the layout, for the property of the UI element visible, bind the context attribute INPUT_VIS.
Now based on your condition, set INPUT_VIS = 'X' (to view) or INPUT_VIS = ' '(to hide) as a value to the context attribute.
Hope this helps,
Regards,
Wenonah
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
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.