Skip to Content
author's profile photo
Former Member

Lost reference of main controller within popup

Dear all,

Within my application, I need to launch a popup to display some datas by using some attributes of my main controller. But when I launch the popupcontroller, I'm not able to retrieve the reference to my main controller inside the do_request of the popupcontroller. Does someone have a clue on it? Thanks..

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 30, 2005 at 01:16 PM

    There are a lot of options.

    I suggest to store the instance of your main controller or model into a static attribute of an utility class.


    Add comment
    10|10000 characters needed characters exceeded

    • Former Member


      First of all, thanks for your answer. But could you give me more details on how to do that and what do you mean by utility class?


  • Sep 30, 2005 at 01:42 PM

    Hi William,

    when a popup is opened the controller which renders it will not have a reference to any other controllers because it is a complete new controller which was not created by a parent controller (you are opening the popup via javascript, right?).

    So you have three options:

    1)like Sergio suggested create an class with public static attributes which can be accessed from both controllers.

    2)Create an application class because every controller has automatically a reference to this class (search for application class in the forum there are lots of hints how to do it).

    3)Transfer information to the popup controller so that it can read the data which it should display by itself. For example call the popup like this:



    Message was edited by: Thomas Ritter

    Add comment
    10|10000 characters needed characters exceeded