on 08-11-2014 6:13 PM
I am trying to get a reference of webdynpro component in assitance class and control its layout on a particular action. Is this possible?
Hi,
Create an attribute (say gr_view) of type ref to if_wd_view in your assistance class. Then in your WDDOINT method of view, write the below code to get the view reference:
data lr_view type ref to if_wd_view.
lr_view ?= wd_this->wd_get_api( ).
Now set this view reference to the attribute in assistance class
wd_assist->gr_view = lr_view.
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Geeta,
Create one instance attribute namely WD_CONTEXT in your assistance class of type IF_WD_CONTEXT_NODE and in wddoinit( ) of component controller just write the below code.
wd_context = wd_context.
Then you can access all the nodes of your webdynpro into your assistance class.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Geeta,
You can get the reference of the component controller by its interface and call interface methods to interact with View.
For example, you can trigger events that can be caught by the view's event listeners.
But you cannot access view's api directly.
Similarly you can use WDDOMODIFYVIEW to pass VIEW as IF_WD_VIEW to your application controller. Then you might be able to manipulate the view.
Let me know if you find out how...
WDDOINIT of the componentcontroller
z_cl_hrpso_wd_assist_main=>add_comp_controller( io_object = wd_this ).
This is the method I use to call refresh in all instances of the component.
METHOD add_comp_controller.
"by passing the reference of the interface controller.
DATA: lo_wd_component_interface TYPE REF TO ZIWCI__XXXX_REGION_SEL.
lo_wd_component_interface ?= io_object.
READ TABLE t_comp_controller WITH KEY table_line = lo_wd_component_interface TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
APPEND lo_wd_component_interface TO t_comp_controller.
ENDIF.
ENDMETHOD.
METHOD refresh_all_comp_controllers.
DATA lo_object TYPE REF TO object.
DATA: lo_wd_component_interface TYPE REF TO ziwci__XXXX_region_sel.
LOOP AT t_comp_controller INTO lo_object.
lo_wd_component_interface ?= lo_object.
CALL METHOD lo_wd_component_interface->global_refresh( ) .
ENDLOOP.
ENDMETHOD.
Cheers
Emre
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.