on 07-09-2007 11:58 AM
Hello.
There is a model class containing the business logic.
In my component controller I instantiated the model class 'CL_IRM' in the init method:
data: lo_irm type ref to cl_irm.
CREATE object LO_IRM.
I also have an attribute in the compController:
lo_irm type ref to cl_irm
.
How can I get and set data of the same instance lo_irm from the other controllers (views).
What's the right syntax?
Do i have to set an attribute type ref to cl_irm also in the other controllers to work with the same instance.
Is there a general recommendation for data transport between model class and different controllers.
Kind regards.
Carola
Hi Carloa,
Have an instance attribute in your component controller. This attribute can be accessed from all the views using wd_comp_controller->attribute_name. In the init method, after creating the object, assign it to the comp controllers attribute. When you want to access it in the component controller itself, use prefix wd_this. And when accessing from the views, use wd_comp_controller.
The class methods can be called directly as wd_comp_controller->attribute_name->method_name( ).
Regards
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, to you Anzy and Nithya.
Carola
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
just one more question to Anzy's response
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks.
Because the model class does already exist whereas the assistance class must have a certain inheritance, the assist class does not help in this case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
maybe it's better to use an assistance class,
which you set in the component overview,
this class can automatically be reached by attribute wd_assist,
grtz
Koen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Carola,
if we want to use the used component we instantiate the component, use the code wizard and it will generate the code.
If we want to transfer the data between the components, we can create the interface methods or using the context. If you want to call the methods then use the reference of the interface.
Best regards,
Suresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
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.