cancel
Showing results for 
Search instead for 
Did you mean: 

Visibility Property

Former Member
0 Kudos

hi All,

I have placed one Tranparent container with some UI Elements inside.

I want to set the Transparent container's visibility to none in view init method.

And also i want to set the Transparent container's visibility as visible in a button click event.

For that i have created an Attribute 'Visibility' with type WDUI_VISIBILITY.

I want the coding that has to be written in the view init method and in the button click action.

Regards,

Dinesh

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi dinesh ...



  DATA lo_el_context TYPE REF TO if_wd_context_element.
  DATA ls_context TYPE wd_this->element_context.
  DATA lv_string LIKE ls_context-string.
* get element via lead selection
  lo_el_context = wd_context->get_element(  ).

* get single attribute
  lo_el_context->set_attribute(
      name =  `STRING`
      value = '01' ).

string is the name of the attribute that is bound to the viisibility property.

---regards,

alex b justin

Former Member
0 Kudos

Hi justin,

Thanks for your reply.that works fine.

I want to make the ui element visible in button click event.

How to achieve this.

Thanks in advance

Regards,

Dinesh

Former Member
0 Kudos

hi dinesh.....

in the method on click just change the value to 02.

---regards,

alex b justin

Former Member
0 Kudos

hi Justin,

thanks for your reply.

Can you clear me , why we have to write these two lines.

DATA ls_context TYPE wd_this->element_context.

DATA lv_string LIKE ls_context-VISIBILITY.

For testing purpose i have changed the visibility property to '02' in init method. But still the Trasparent container UI element is invisible.

Regards,

Dinesh

Former Member
0 Kudos

Hi Justin,

Your codes worked fine....Thanks....

I want to know how to code in webdynpro ABAP from Basics.

and I need the sample codes in Webdynpro ABAP.So if possible please send me materials to my mail-id 'shiv.dinesh@gmail.com'

Regards,

Dinesh

former_member515618
Active Participant
0 Kudos

Hi Dinesh,

The 2 statements are for data declerations.

ls_context is to hold the reference to the context element and the lv_string for holding the value of the visibility property.

The WDDOINIT method of a given view is triggered only for the first time when the view is rendered. So next if you go back and come in the view again the WDDOINIT is not called.

So if you go back and come into the view, the transparent container is still in the same state as it was.

Regards,

Sravan Varagani