on 07-24-2008 12:41 PM
Hi!
Can someone show me how to access the properties of ui elements during runtime?
eg. in the method WDDOINIT i want to enable/disable the GroupBox "Group"
how to?
thanks
anyway, this way works... thanks Abhi
Its just hard for me to get familier with all the classes here.
Thats why i would like to now how i can change properties of a UI Elements in general during runtime... Which class do i have to use and so on..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ideal way is the one i specified,
other way is you have to change it in WDDOMODIFYVIEW
to get any UI element this is the code
view->get_element( '<ID of the UI element>' ). which return the corresponding UI element reference
the UI element classes start with CL_WD_*.
for example: inputfield CL_WD_INPUT_FIELD
data: lr_input type ref to cl_wd_input_field.
lr_input ?= view->get_element( '<ID of the UI element>' ).
lr_input->set_enable( abap_true ).
Abhi
>
> ideal way is the one i specified,
>
> other way is you have to change it in WDDOMODIFYVIEW
>
> to get any UI element this is the code
>
> view->get_element( '<ID of the UI element>' ). which return the corresponding UI element reference
>
> the UI element classes start with CL_WD_*.
>
> for example: inputfield CL_WD_INPUT_FIELD
> data: lr_input type ref to cl_wd_input_field.
> lr_input ?= view->get_element( '<ID of the UI element>' ).
> lr_input->set_enable( abap_true ).
>
> Abhi
I would like to stress that this NOT the SAP recommended way of controlling the properties on UI elements - the first solution you were give would be the recommended approach. The direct UI coding access should be used as a last resort when working with dynamically generated UI elements. Otherwise you should always try and set the UI element properties via context binding. This makes your application more accessible to customizing/personalization, makes it easier to maintain over time and provides the best performance.
Is there a other way to access the properties directly?
actually i want to use ENABLED true/false and not visible?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for doing it in WDDOINIT, you can directly change the visible property to none.
nyways here is the procedure
1. create a context attribute of type WDUI_VISIBILITY
2. bind it with the visible property of the UI element
3. code to set the attribute with appropriate value
to disable
wd_cotnext->set_attribute( name = '<attrib_name>' value = if_wdl_core=>visibility_none ).
to enable
wd_context->set_attribute( name = '<attrib_name>' value = if_wdl_core=>visibility_visible ).
Abhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
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.