cancel
Showing results for 
Search instead for 
Did you mean: 

Execute method from outside the view

Former Member
0 Kudos

Hi,

I have a method in view X that I would like to execute from view Y. what is the API for executing a methods from another view? (I know the API for executing a method in the controller, but now I refer to a method in the view).

Thanks in advance,

Aviad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Aviad,

As far as I know, there is no direct way to access a view's method from another view. But you can achieve this functionality using events.

1) Create an event and a method to fire this event in your component controller.

2) Create a corresponding event handler in the second view, which will call the desired function.

3) Now from the first view, you can call the event triggering function of the component controller. This will inturn execute the method in the second view.

If you need to manipulate some data, you can either pass them as Event parameters or use data mapping.

Hope this helps,

Best Regards,

Nibu.

Message was edited by: Nibu Wilson

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

Hello Aviad,

It is not possible to direct call method of one view from another. Use custom controller methods with appropriate context mapping.

Best regards, Maksim Rashchynski.