cancel
Showing results for 
Search instead for 
Did you mean: 

TabStrip and ViewContainerUIElement

Former Member
0 Kudos

Hello Experts,

I have MAIN view which contains one tabstrip control having 3 tabs. Each tab consists of one ViewContainerUIElement. Currently when I test the main View, All the views are displaying correctly, and control goes as follows:

1. WDINIT of MAIN

2. WDINIT of First view which is present in first tab's ViewContainerUIElement

3. WDINIT of Second view which is present in second tab's ViewContainerUIElement

4. WDINIT of Third view which is present in third tab's ViewContainerUIElement

But my requirement is as discussed below.

Each time view's WDINIT should be called when use clicks on Tab. That means initially first tab is displayed and when user click on second tab, WDINIT of view present in second tabs's ViewContainerUIElement should be called and same for third view as well.

Could you please give me any pointers on this? I tried to set Lifetime property of views but no success.

Thanks,

Prashant

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You are going to have to change the way the tabstrip itself works. By default the tabstrip renders all the inner tabs at once and then does the tab switch on the client side wihtout a return to the server. This causes more initial processing but saves time on each tab switch.

If you want a server event on each tab switch, then you need to use onSelect event of the tabStrip. In this event you will need to trigger a navigation plug in the Window. Within the processing of this navigation plug, you fire additional plugs that will switch between EMPTYVIEW and the real view in each tab/viewContainer. Any currently invisible tabs should be switched to the dummy EMPTYVIEW. This action combined with the lifetime setting will cause the inner view to be destroyed. Consequently when the user reselects this tab it will be recreated and the WDDOINIT will fire again.

Answers (0)