cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way for assistance class to get reference of wda and control it’s view

Former Member
0 Kudos

I am trying to get a reference of webdynpro component in assitance class and control its layout on a particular action. Is this possible?

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member184578
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

eozkan
Explorer
0 Kudos

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

Former Member
0 Kudos

I am kind of lost here.. Is there a standard global refresh method available at componet controller level ?