on 03-25-2009 11:05 AM
Hi ,
I have Designed 3 container each containing two attributes . Container2 / Container3 have a Text above it and a Lable along with a dropdown. When i select any of the line (Record) in the first container , based on this condition the related layout of container 2 and container3 should be invisible/visible . Can you give some sample code please .
Thanks,
Kumar
Hi,
Take context attribute for VISIBILITY as WDUI_VISIBILITY bind this to the respective container of
VISIBLE property and fill that attribute based on condition.
Here I have one textview and other is TCO. based on the condition Im setting the visibility of the UI elements by taking two context attributes.
Sample code written in WDDOMODIFYVIEW -
DATA:
lv_no_projects type wdui_visibility, "Visibility for No projects textview
lv_projects type wdui_visibility, "Visibility for TCO projects
***UI element reference objects
lr_txtview type ref to cl_wd_text_view, "Text view
lr_tcoproj type ref to cl_wd_transparent_container, "Transparent container
lr_view_ele type ref to if_wd_view_element. "View UI element
if lt_projects is initial.
lv_no_projects = '02'. "VISIBLE
CALL METHOD wd_context->SET_ATTRIBUTE
EXPORTING
VALUE = lv_no_projects
NAME = wd_assist->gc_NO_PROJECTS.
CALL METHOD VIEW->GET_ELEMENT
EXPORTING
ID = wd_assist->gc_TXV_NO_PROJECT
RECEIVING
ELEMENT = lr_view_ele.
lr_txtview ?= lr_view_ele.
CALL METHOD LR_TXTVIEW->SET_VISIBLE
EXPORTING
VALUE = lv_no_projects.
else.
CALL METHOD VIEW->GET_ELEMENT
EXPORTING
ID = wd_assist->gc_TCO_PROJ
RECEIVING
ELEMENT = lr_view_ele.
lr_tcoproj ?= lr_view_ele.
lv_projects = '02'. "VISIBLE
CALL METHOD wd_context->SET_ATTRIBUTE
EXPORTING
VALUE = lv_projects
NAME = wd_assist->gc_PROJECTS.
CALL METHOD LR_TCOPROJ->SET_VISIBLE
EXPORTING
VALUE = lv_projects.
endif.
Regards,
Lekha.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
->Bind the Visible property of Container 2 and Container3 with two context Attribute of type Wdui_visibility.
-> Now according to values in First drop down, set the visiblity property of Container 2 or 3.
-> For making Visible , set the context attribute value as 02.
-> You can do set the attribute using Code wizard ( control + F7).
Thanx.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kumar,
For this you have to create 2 attribute in your context of type WDUI_VISIBILITY and map them to the visible property of both the container in your view.
After that based on some condition on an action you can set the value of visibility attribute to '02'.
For example:
Suppose
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_visible LIKE ls_context-visible.
if lt_data[] is not initial. "Based on some condition
lv_visible = '02'.
lo_el_context->set_attribute(
EXPORTING
name = `VISIBLE`
value = lv_visible ).
endif.
Hopes this will helps you.
Regard
Manoj Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.