on 03-17-2014 1:11 PM
Hello,
is it possible to call a method included in a View from the Component Controller?
Thanks,
Cengiz
hi Cenzig,
You may not directly call a method of View from the component controller. But as far as I can recall, if you define an event handler in a view controller and trigger the event from the component controller. This would mean that you triggered code in the view controller from the component controller!
That said, it is a good programming practice to call code in component controller from view controller and not vice versa !
Cheers,
-Amol Gupta
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Amol,
many thanks. So that means:
1) I create an Event in a View (Controller)
2) I create an Event Handler in a Component Controller and trigger here the View-Event?
But I couldn't found a way how to trigger the View's Events from a Component Controller (please have a look in my screenshots).
Thanks, Cheers,
Cengiz
Hi Cengiz,
Jun said it right. Create event in component controller.
And create event handler in view controller.
When you trigger the event (defined in component controller) that event will be handled by the event handler (defined in the view controller). In this manner you will be able to call code in view controller from component controller.
I will remind again, it is a good programming practice to call Component Controller code from View Controller and not vice versa. Do a deviation if the situation demands it but not as a usual programming habit.
Cheers,
-Amol Gupta
Hi Amon / Jun,
thanks. I have implement the following tasks:
1) Creating an Event in Component Controller (PNG file 1)
2) Creating a Method in Component Controller (PNG file 1)
3) Triggering the Component Controller Event by the Interface (Component) Controller (PNG file 2)
4) Creating an Event Handler in the View (PNG file 3)
Please see my attached files.
Thanks a lot, Cheers,
Cengiz
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.