cancel
Showing results for 
Search instead for 
Did you mean: 

Interface View interaction in DC

Former Member
0 Kudos

I am calling an interface view dc as pop up window from another dc.

The first time it works fine. When I hit the close or select option in interface view..the event handler destroy's the window instance. When I select the button to open the pop up again, it does not go through the wdDoInit, instead it retains the last state of the popup and hence does not initialize the content of the pop up.

I have done this with all views in same project. I am seeing this issue only when I am using the interface view which was declared as public part.

If I refresh the screen and come back again, it works. What am I missing. Do I need to initialize Interface View Instance every time I call pop up. If so how do I do that.

I am stuck at this and need to resolve this. Any help or discussion is highly appreciated..

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member201361
Active Contributor
0 Kudos

Hi Ravi,

this issue is not related with interface View.

just change the Lifespan property of the View to When Visisble , instead of Framework controlled.

open ur view controller which is displayed in the pop up window, switch to properties Tab, here select Life span property to "When Visisble". so that when ever this view is called , the doInit method will be called.

Hope it helps,

Thanks and Regards

Former Member
0 Kudos

Fazal,

Thanks for your response. I tried changing the life span property to visible, it still did not help.

The view still remembers the state of the pop up.

I tested the concept by creating a local view inside the project inside a window and opened the window as pop up..in this case it works fine. When I close and destroy the instance and reopen, the context variables are reset and it executes WdDoInit.

The issue is only with interface view. I created a window, embedded the interface view. Called this view as pop up from my primary view. The pop opens fine the first time. I select a value from the table or close button...the primary view handles the event and destroys the window instance.

If I try to reselect another value it remembers the state and does not execute the WdDoInit. How do i reset the state of View/or kill the view instance along with Window Instance.

I am not sure if I am missing a property in DC usage.

Any DC gurus outthere...

Thanks

former_member201361
Active Contributor
0 Kudos

Hi Ravi,

ya , the problem is not with the lifespan property, can u check whether u are destroying the component usage while destroying the pop up window instance. and use message manager to check whether the doinit method is called or not.

if u are not destroying the component usage, then destroy the usage

wdThis.wdGet<Component Usage>.deleteComponent();

Thanks and Regards,

Former Member
0 Kudos

Fazal,

Thanks for your response.

My DC component creation is not manual. It is created automatically, so I do not see the component usage method.

I am not sure if I need to change the property to manual and try ... I still do not understand why there is a difference between local view and interface view. and how to destroy view instance..

Thanks

Ravi

former_member201361
Active Contributor
0 Kudos

Hi Ravi,

I am not sure if I need to change the property to manual and try ... I still do not understand why there is a difference between local view and interface view. and how to destroy view instance..

u have to delete the component coz u are destroying the window instance only but the component is still alive and holds the value when u are calling the component for the first time.

while destroying the window instance, use this code.

wdThis.wdget<Component Usage>.deleteComponent();

Thanks and Regards

Former Member
0 Kudos

Fazal,

Thanks for the help...Yes DeleteComponent was the key. For DC's it is best to set the component usage to manual and create and delete components as needed. Once I changed it worked for me.

Awarded full points.

Thanks again.

Answers (0)