cancel
Showing results for 
Search instead for 
Did you mean: 

Call a View method (plugin) from the Component Controller

Former Member
0 Kudos

Hello,

is it possible to call a method included in a View from the Component Controller?

Thanks,

Cengiz

Accepted Solutions (1)

Accepted Solutions (1)

amolgupta
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

junwu
Active Contributor
0 Kudos

1. create event in component controller

amolgupta
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

amolgupta
Active Contributor
0 Kudos

hi Cengiz,

Is your problem resolved or you are still stuck ?

Regards,

-Amol

Former Member
0 Kudos

HI Amol, sorry have forgotten to close it.

Many thanks for help.

Cheers,

Cengiz

Former Member
0 Kudos

Hey cengiz, you can  kindly  mark the right answer as correct answer.

Former Member
0 Kudos

Hey Abaper, I thought I already done it (?)

Answers (0)