Skip to Content

How to Access Controller Function from within onBeforeShow(evt) in view

Scenario: I have a view and its corresponding controller.

Requirement: From onBeforeShow(evt) of view, I want to access a function of controller. How do I do that?

-Regards

Dhrubajyoti

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 08, 2014 at 06:25 AM

    Hi Dhrubajyoti,

    This would be possible.

    Check out the snippet here

    Regards,

    Atanu

    Add a comment
    10|10000 characters needed characters exceeded

    • Well..Thanks Atanu 😊

      I just figured Out another way. As the createContent(oController) of the view gets called first, we can have this.controller = oController inside createContent(oController)

      onBeforeShow(evt) {

      alert(this.controller); //Here we can access this

      }

      createContent(oController) {

      this.controller = oController;

      }

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.