on 05-10-2012 6:55 AM
How do we get the instance of a webdynpro component into some class.Can somebody please help me.
got the answer by myself, thanks fareez.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fareez,
Can you please eloborate a bit. I am not getting what you are suggesting.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
What I was trying to tell is to pass the reference of the wd_comp_controller and wd_this of the view you wish to the your class through a method or constructor. You are going to do everything as usual. Instead of doing the process in the action, you should call the method of the class passing wd_comp_controller(current component) and wd_this (current view) to the method.
Regards,
Fareez
Hi,
What I was trying to tell is to pass the reference of the wd_comp_controller and wd_this of the view you wish to the your class through a method or constructor. You are going to do everything as usual. Instead of doing the process in the action, you should call the method of the class passing wd_comp_controller(current component) and wd_this (current view) to the method.
Regards,
Fareez
I am trying like,
In WD Component.
METHOD get_ref .
DATA: lo_comp TYPE REF TO if_wd_component.
* lo_ctrlr type ref to IF_WD_CONTEXT_NODE.
lo_comp = wd_this->wd_get_api( ).
lo_context ?= wd_context.
go_obj->get_comp( LO_COMP_CONTEXT = lo_context ).
* wd_assist->get_context( lo_context = lo_context ).
ENDMETHOD.
***************************************************************
In constructor of my class i am creating the object go_obj.
************************************
IF go_obj IS NOT INITIAL.
CREATE OBJECT go_obj.
ENDIF.
***************************************
Its giving error as go_obj unknown in my method get_ref in webdynpro(I have declared it in attributes of the comp controller and parameters of the get_ref method).
Hi
I think what you try to achieve is wrong.
SAP designed the controller (view or component) in order to maintain
your code there. No where else. If you feel you must have a different
class, you can always start a new custom controller.
In this way you will have a robust design that is supported
by the framework.
regards
yuval peery
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Actually the requirement is to get the instance of the component controller context into one class and handle all UI related bindings over there. How to achieve this, any help regarding this is very helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arafat,
What is the requirement you are trying to achieve. Can you specify more clear?
Regards,
Fareez
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arafat shaik,
look the below code you can understand.
* Declare ALV config table
data: ALV_CONFIG_TABLE type REF TO CL_SALV_WD_CONFIG_TABLE.
DATA: wd_table_usage TYPE REF TO if_wd_component_usage.
* Create an instance of ALV component created ALV_COMP is usage name
wd_table_usage = wd_this->wd_cpuse_alv_comp( ).
IF wd_table_usage->has_active_component( ) IS INITIAL.
wd_table_usage->create_component( ).
ENDIF.
* Get ALV component
DATA: wd_table TYPE REF TO iwci_salv_wd_table.
wd_table = wd_this->wd_cpifc_alv_comp( ).
alv_config_table = wd_table->get_model( ).
* Declare variable to store column details
DATA: column_settings TYPE REF TO if_salv_wd_column_settings,
column TYPE REF TO cl_salv_wd_column.
column_settings ?= alv_config_table.
Thanks,
Venkatesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
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.