on 11-22-2012 4:09 PM
Hi Experts,
In my scenario I've got following navigations:
ViewMain <---> view1 <---> view2 <---> view3.
I am able to navigate between the views back and forth. The views are not destroyed since Lifetime is set to "Framework Controlled".
But I need to initialize view1, view2 and view3 when navigating between ViewMain <--> view1 (both directions) and while navigating between view1 <---> view2 <---> view3 they have to be alive.
But if I set the Lifetime of view 1 to "when visible", it is also destroyed when navigating between view1 <---> view2 <---> view3.
How can I explicitly destroy view1, view2 and view3 when navigating between ViewMain <---> view1?
Setting Lifetime to "when visible" does not help me in this case.
Thanks for your answers.
Ismail
Hi,
It may not be exactly what you are looking for but you can take a different approach of initializing the views in Handler method for Inbound plugs.
If you have some piece of code written in WDDOINIT of these views, you can move this code to Inbound plug Handler methods.
Regards,
Rohit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thats an idea, but anyway I need to destroy other views too.
So I need to find a way to identify "living" views during runtime (RR) and destroy them.
If I know how to destroy these instances, then you are right, I could do it within the plug handlers.
Does anybody know if it is possible and how I can destroy views? I need something like "DELETE_COMPONENT" for component usages, but for views.
Hi Amy,
sounds good. I'll try that.
One more question regarding this.
Assume view1 is embedding view2. Is view2 also initialized when resetting view1?
What about active components used within the reseted view?
(Do I have to handle every instance used within the view separately?)
Best regards
ismail
Hi Ismail,
Resetting view1 will not cause view2 to reset automatically. I'm curious if what you want is really to "destroy" the views or if what you want is to re-initialize the context nodes used by the views?
If you really want the view "destroyed" and re-initialized as is done with a lifetime of "when visible", then reset_view will do this. However, if you're trying to "refresh" the view field values, what you want may instead be to invalidate the context node(s) used by the views with if_wd_context_node->invalidate. This method will cause the context node to be reinitialized and its supply function re-executed.
Cheers,
Amy
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.