cancel
Showing results for 
Search instead for 
Did you mean: 

Lost reference of main controller within popup

Former Member
0 Kudos

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..

Accepted Solutions (1)

Accepted Solutions (1)

SergioFerrari
Active Contributor
0 Kudos

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.

Sergio

Former Member
0 Kudos

Sergio,

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?

Will

Answers (1)

Answers (1)

thomasalexander_ritter
Active Contributor
0 Kudos

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: materialpopup.do?displaymaterialnumber=12345

regards

Thomas

Message was edited by: Thomas Ritter

Former Member
0 Kudos

Thanks a lot guys it works perfectly...

Have a great day.

Will