on 12-10-2008 11:17 AM
hello,
how can i call a view method from componentcontroller method?
thanks
marcus
Hello Marcus Ventur,
As you already know you cannot call a view method from component controller(CC).
There are only two possibilities:
1)Write the code into CC method which you wanted to access from both the view level and CC level.
Then you can access this method from both View and Component Controller.
2)If this is not necessary to access through interface method to the component controller,
May be you can try working with firing an event from the view level(Reused Comopnent) and catch it at Main WD component controller/View(as you said,u came from other WD component) level.
Thanks,
Bharath.K
Edited by: Bharath Komarapalem on Dec 10, 2008 5:40 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, but its not so easy. it is not my half-baked application.
now i made a boolean public context attribute.
if i came from the interface method, the context attribute EQ 'X'.
In the modify of the view i check the context attribute. if X -> call method, if not, do nothing.
so its not fine but it works.
thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes, i know. but i came from an other webdynpro with an interface method to the component controller. here i want call an method from the view.
and if i have an instance of the view in the componentcontroller?
bg
marcus
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Marcus,
As you said instance of view is already there when you are creating component controller's instance. So you work is done. You have to have event handlling mechanism.
1. Create an event in your componentcontroller (Used component).
2. Have a interface method in the same component controller. Now from you component you can call this method right.
3. In the implementation of this interface method fire the event which you have created in step 1.
4. Write eventhandler for this compnent's event in the view where actuall method is.
So the moment u will call interface method of component it will fire component's event and it turn this event will be caught by the event hadler u have written in view.
5. Now in implementation of this view's eventhandler call the view's required method.
And job is done.
Only thing event hadler of view will work only in case view is initialized in memory. As you said you have the view instance so no probs..
Ask in case of any doubt.
Regards,
Neha Modi
Hi,
You can not call view method from the component controller.
Better You write that method in the component controller only. By this You can use this method in component controller as well in any view also.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.