on 06-01-2009 10:00 AM
Hi,
I want to show and hide the inputfields on the buton click.
I want to do it without any context attributes.
is it possible?
is it possible to change the control properties without contextattributes in codeing?
Regards,
Kumar K
Hi,
Yes you change the properties without binding to some context atrribute.
Here's a sample code for it. You may code this in WDDOMODIFYVIEW method.
data: lr_container type ref to cl_wd_uielement_container.
data: lr_inp type ref to cl_wd_uielement.
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_inp = lr_container->get_child(
id = 'INPUT_FLD_1'
* index = index
).
lr_inp->set_enabled( value = abap_false ).
Regards,
Runal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
View is not available in the button action method, it is available only in viewmodify. Hence the error.
TCreate an attribute l_view and try saving the reference of the view in this attribute in viewmodify method .
wd_this->l_view = view.
and then in your button action, write as follows
lr_container ?= wd_this->l_view->get_element( 'ROOTUIELEMENTCONTAINER' ).
Try this.It may help.
Regards,
Radhika.
The suggestion to use the WDDOMODIFYVIEW approach - although technically possible is not the SAP recommended approach. It is recommended that instead you bind context attributes to the visible property of the UI element and control this by changing the context attribute. This way the definition is made independent up the UI element itself and done via context binding. This makes the functionality more reusable and easier to maintain. The WDDOMODIFYVIEW should only be used as a last resort when you have dynamically generated UI elements and you need to create or maniuplate them.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi kuppusamy,
As i told you in the same thread.
if you want to use the View reference in any of the methods please maintain a view level attribute of type IF_WD_VIEW and in METHOD WDDOMODIFY just assign the VIEW importing parameter direct ly WD_THIS->CURR_VIEW if the attribute name if curr_view. so you can get the current view reference in any of the methods like WD_THIS->CURR_VIEW.
Regards,
Anil kumar G
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
its working but
i have to do that in button click
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
You may create an attribute in the view controller as
GV_VIEW type ref to IF_WD_VIEW.
Then in the event handler method of the button put this code.
data: lr_container type ref to cl_wd_uielement_container.
data: lr_inp type ref to cl_wd_uielement.
data: value_enbl type abap_bool.
lr_container ?= wd_this->gv_view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_inp = lr_container->get_child(
id = 'INPUT_FLD_1'
* index = index
).
lr_inp->set_enabled( value = abap_false ).
And in the WDDOMODIFYVIEW mwthod put this peice of code
method wddomodifyview .
wd_this->gv_view = view.
endmethod.
Regards,
Runal
Hi Kuppusamy,
You can do this without context nodes also by getting the reference of the UI elements directly..
For example in the below code iam making invisible the UI Element container.
data : lo_ui_ovr type ref to if_wd_view_element.
data : lo_cont type ref to cl_wd_uielement_container.
data : view_1 type ref to if_wd_view.
lo_ui_ovr = curr_view->get_element( id = 'NODE_CONT' ).
lo_cont ?= wd_this->lo_ui_ovr.
lo_cont->SET_VISIBLE( abap_false ).
This code will get the UI element of ID 'NODE_CONT' and make that invisible.
here the CURR_VIEW is the cyrrent view reference which will be avaliable in WDDOMODIFY method. but if you want to get this in any method just maintain a View level attribute of type IF_WD_VIEW and store the curr_view as the current view from WDDOMODIFY method and access that any method like
WD_THIS->CURR_VIEW.
Regards,
Anil kumar G
Edited by: Anil Kumar on Jun 1, 2009 2:37 PM
Edited by: Anil Kumar on Jun 1, 2009 2:37 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.