on 02-18-2011 9:16 AM
Hi Friends,
I want to use Method A of Component A in Component B. Can some one tell me how to call method A on action of a button in component B.
Regards
Sankar
Have you declared Comp A as a component usage in Comp B.
In the COMP A, make the methods as Interface methods there will be a check box.
Inside the Comp B, instantiate the Comp A, using the instance you can call those methods of Comp A inside Comp B on the button action. you can instatiate the usage usign the code wizard.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> Hi Lekha,
>
> k fine thank you. Now calling method is same as calling assistance class. is it right or any other way
>
>
> regards
> sankar
yup kind of similar to that
You need to create the controller usage of the interface controller for the used comp A in view or comp controller where you
want ot use it and then call interface method by instatiating the interface controler first and then calling method using this method.
You can generate the code using the code wizard.
firs tyou need to add the interface controler of the comp A in the used controllers list of view or comp controler where ever
you want to call
here is the sample code
*create the usage of comp A
data lo_cmp_usage type ref to if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_COMPA( ).
if lo_cmp_usage->has_active_component( ) is initial.
lo_cmp_usage->create_component( ).
endif.
*call the interface controller of comp A
DATA lo_INTERFACECONTROLLER TYPE REF TO ZIWCI_SSG_FEB_EXPL7 .
lo_INTERFACECONTROLLER = wd_this->wd_cpifc_COMPA( ).
lo_interfacecontroller->method1(
).
Hi,
DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
lo_cmp_usage = wd_this->wd_cpuse_method( ).
IF lo_cmp_usage->has_active_component( ) IS INITIAL.
lo_cmp_usage->create_component( ).
ENDIF.
DATA lo_interfacecontroller TYPE REF TO yiwci_sg_method .
lo_interfacecontroller = wd_this->wd_cpifc_method( ).
lo_interfacecontroller->execute_method(
).
i was able to do the above process successfully but how to bind data to the node of component 2.
In the component 1 : method A i defiend to get records upto 25 rows. now i tried using same method . but how to bind data using this method
Regards
sankar
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.