cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding an UI element dynamically in webdynpro ABAP

Former Member
0 Kudos

Hi Gurus,

I want to hide a Interactive form UI element dynamically at run time. Please let us know how to proceed with this and provide the code for this, which will be helpful.

Thanks

Rahul

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Declare one Attribute in Context node which is of type WDUI_VISIBILITY.

Now bind the above declared attribute with the value property of your UI element.

Now By using CODE wizard ... select the SET radio button and then choose the attribute which is created in Context node...it will generate some predefined code which is shown below

For Ex:

node->set_attrubute(

------

value = lv_attribute

).

Visibility Criteria:

If you want to hide the UI element use

lv_attribute = 01.  (value for hiding) just above the auto generated code which is shown above.



----------------------------------------

If you want to  unhide/show the UI element use 

lv_attribute = 02. (value to show UI element) just above this auto generated code which is shown above.


You can use this procedure based on button clicks; Like, On click of BUTTON you can display some text elements or TEXTEDIT etc...


Former Member
0 Kudos

hi ,

bind the VISIBLE property of the UI element with a context attribute created in the CONTEXT tab. This context attribute should be of type WDUI_VISIBILITY

u can refer this code


wd_context->set_attribute( name = '<attribute name>' value = if_wdl_core=>visibility_visible )." to make it visible.
 
wd_context->set_attribute( name = '<attribute name>' value = if_wdl_core=>visibility_none ). "to make it invisible

regards,

Amit

Former Member
0 Kudos

yeah my mistake, attribute should be of type as told by Amit.

Regards

Manas Dua

Former Member
0 Kudos

Hi Rahul

Step-1 : Declare a attribute of type WBY_BOOLEAN in the Context of the view.

Step-2 : Bind these attribute to the Visible Property of the Interactive Form

Step-3 : In Code set the attribute value to ABAP_FLASE by using SET_ATTRIBUTE where ever u need

And Interactive Form is Invisible.....!!!!!!

Former Member
0 Kudos

Hi,

Bind the Interactive Form Ui element Visibile property to an attribute created in context of type wdy_boolean.

Now based on your condition set this attribute to true or false and control the visibility.

Regards

manas Dua

Edited by: Manas Dua on Apr 9, 2010 12:38 PM