Skip to Content
0
Former Member
Apr 15, 2015 at 05:58 AM

Web dynpro UI element visibility

1106 Views

Hi

My situation is this.

I have a view on which I want to display certain fields to the user depending on whether a particular value is present in a database table.

In the Context I have attributes of type WDUI_VISIBILITY which are mapped to the relevant UI elements in the layout that I want to set to visible or not when the view loads.

In the WDDOINIT method I have declared local variables like so: DATA lv_visible TYPE wd_this->element_properties-visible.


I then perform the database check which I can see is fine in debugging and assign values to my local variables:



IF lv_unfal NE 'X'.
lv_visible = 02.
lv_hod_visible = 01.

ELSE.
lv_visible = 01.
lv_hod_visible = 02.


And then assign those values to the context element.



lo_el_properties->set_attribute( name = 'VISIBLE' value = lv_visible ).
lo_el_properties->set_attribute( name = 'HOD_VISIBLE' value = lv_hod_visible ).
lo_el_properties->set_attribute( name = 'HOD' value = lv_hod_vis ).


However on loading the view not all of the UI elements are being made visible/invisible as I would expect/hope! I am missing something here? I've used this concept before and it worked ok. Is is something to do with the WDDOINIT method?


As always very grateful for any suggestions.


Thanks

Jon