cancel
Showing results for 
Search instead for 
Did you mean: 

how to change visibility property of a context in wd abap

arjun_thakur
Active Contributor
0 Kudos

hi experts,

i have binded a context of wdui_visibility type to a ui element. now i want to change this visibilty property at run time. i have written the folling code:

data lo_nd_visible type ref to if_wd_context_node.

data lo_el_visible type ref to if_wd_context_element.

data ls_visible type wd_this->element_visible.

data lv_visibility like ls_visible-visibility.

  • navigate from <CONTEXT> to <VISIBLE> via lead selection

lo_nd_visible = wd_context->get_child_node( name =

wd_this->wdctx_visible ).

  • get element via lead selection

lo_el_visible = lo_nd_visible->get_element( ).

  • get single attribute

lo_el_visible->get_attribute(

exporting

name = `VISIBILITY`

importing

value = lv_visibility ).

wd_context->set_attribute( EXPORTING name = 'VISIBILITY' value =

abap_false ).

but it is giving a rum time error. the erroe message is : No context named visibility found.

please can anyone provide me the correct code.

thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Since you are accesing the node containing the 'VISIBILITY' attribute you can use the following method to set the value

lo_el_visible->set_attribute(

exporting

name = `VISIBILITY`

value = 01 ). ""01 - none,02-visible

and remove this code

wd_context->set_attribute( EXPORTING name = 'VISIBILITY' value =

abap_false ).

Regards

Tamil

Edited by: Tamilselvan K on Aug 6, 2008 2:40 PM

abhimanyu_lagishetti7
Active Contributor
0 Kudos

we should not hard code the values, it is better to use the constants supplied by the framework

Answers (1)

Answers (1)

abhimanyu_lagishetti7
Active Contributor
0 Kudos

You have mis-spelled the context attribute name VISIBILITY please check.

and the possible values are ( not abap_false and true )

if_wdl_core=>visibility_visible

if_wdl_core=>visibility_none

Abhi