on 12-08-2009 1:47 PM
Hi all,
I have to access a view from another view using views reference. I have created an attribute (view1) of type IF_WD_VIEW_CONTROLLER in component controller and also got the reference of the one view.
now i want to access an UI of that view in another view using the wd_Comp_Controller->view1.
How to do this.. Can any one guide me.
Regads,
Susil.
Hi,
I am having view1 and view2.
in view1 i am using roadmap. S1 is one of the step of road map.
in view1 i used this code to get the reference of this view in componentcontroller attribute
Data: lo_api TYPE REF TO if_wd_view_controller.
If first_time = 'X'.
lo_api = wd_this->wd_get_api( ).
wd_Comp_Controller->my_VIEW = lo_api.
endif.
in my view2 i want to access the roadmap step
i dono how to access that.. i used this code.......
wd_comp_controller->my_view->get_element( 'S1' ).
is this correct.. If not what is the code to get that id..
Can any one tell me clearly...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i think your code gets executed only one time because you have put a condn on first time so its get executed only first time.
so write your code outside the if statement.I think you are also not making the assignment correctly.you should do the assignmet like this
lv_xyz = wd_Comp_Controller->my_VIEW .
where lv_xyz is a local variable
hi ,
u can access the view in either WD DOMODIFY orin some method which is the on Action of some UI ( say Button )
The interface of method wdDoModifyView provides a parameter VIEW, which is a reference to an object of type IF_WD_VIEW representing the instance of a view at runtime.
So, use tht reference using the attribute mr_view .
mr_view refers to the associated TYPE IF_WD_VIEW .
Declare this attribute in the ATTRIBUTE tab and using the refernce .
DATA: lr_container TYPE REF TO cl_wd_uielement_container.
lr_container ?= wd_this->mr_view->get_element('TC_SYSTEM' ).
// "TC_SYSTEM' is ur transparent container inside which is ur UI
regards,
amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if my_view is of type if_wd_view then you are correct..
if you have stil issues, use the pattern button
insatnce : wd_comp_controller->my_view
class - if_wd_view
mehtod get_element
For this method there is importing and exporting parameters...
This will genrate the code for you for calling that method...
just pass that importing value and use the exporting parameter into some value (type IF_WD_VIEW_ELEMENT)
check in se24 for the method signature..
or else use this code
wd_comp_controller->my_view->get_elemnet
exporting
id = 'S1'
recieving
element = lr_vele (decalre this variable of type ref to if_wd_view_element)..
Regards,
Lekha.
Hi..
Ya I have got the reference of the view and stored in an attribute globally in component controller.. I dono how to access it another view....
Can Any one help me out of this
Regards
susil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
*Ya I have got the reference of the view and stored in an attribute globally in component controller.. I dono how to access it another view....*
as you have stored the value in the attribute of component controller.
you can access the comp controller attribute in the view using
in the view where you want to acess use
wd_comp_controller->attributename.
or pass wd_comp_controller->attributename. to some variable so that u can acess it.
lv_data = wd_comp_controller->attributename.
the varible will hold the value .
Priya
What UI you want to access..Please be more clear..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
I geuss you might have decalred some attribute to bind to the selected step right..Is this you want..
or when you create the roadmap in layout that ID you want..
Is this Road map created at design or runtime..
If you want to get the roadmap id then you need code in modifyview method of that view.
view is of type if_wd_view get the view info and you can place this globally so that you can use it in next view..
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.