cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a popup window's initialize method repeatly

Former Member
0 Kudos

Hi.

I'm working with NW7.0.There's some problem with using a model window.

I have 2 component,Comp1 and Comp2.

The main window belongs to Comp1 and the popup window belongs to Comp2.

Comp1 add the useage of Comp2,and create a window "Win2" with Comp2's interface window embeded.

In Comp1 I write the create and hide method for popup "Win2".

I want to write some initialize code for the popup window when it's displayed everytime.

The first time when popup window shows can trigger the wdDoInit method correctly.

But when I close the popup window and open it again,the wdDoInit method wouldn't be trigger any more.

then I try to set the popup view's property Life Span to "when visible",not works.

then I try to write code in the hide popup method: win.hide(); win.destroyInstance(); not works.

Seems the window's instance can't be destroyed be the win.destroyInstance()

then I give up wdDoInit() and try to fire a event in popup window's interface view's Default plugin,but the default plugin method can't be trigger at all,even at the first time when the popup window shows.

can any body give me some suggustion? without write code in wdDoViewModify().

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I think I have a solution for you.

In Comp1:s Component Controller (where I'm guessing your creating the comp2:s view), add Comp2:s Interface Controller. Then create your own initialize method (yourOwnInitMethod() in comp2:s Interface Controller (could call some method in comp2:s Component Controller for instance).

After you have called the window.show(); that creates the comp2:s window, do a wdThis.wdGetComp2Interface.yourOwnInitMethod();

/Björn

Former Member
0 Kudos

Thank you very much,it works~~

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

We are having a similar situation. But we have written the code in the wdDoModify method. Check if the view is executed for the first time using the boolean firstTime attribute, and put the initialization stuff if it is true.

- Asif