cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic Selection of view ontab selection

0 Kudos

Hi experts,

I just want to generate the view on tab selection.

My requirement is that when I select subject in a view(say View A) and press submitt button the view takes me to a different view(say View B).

In View B I have a tabstrip with 2 tabs(say tab1,tab 2).

Now I have embedded one view(say view x) in tab 1.

In tab 2 I want to embed(or call) view based on my selection criteria in view A.

i.e I have views (view P,view Q,view R) and out of this only one should be displayed in tab 2. This selection is based on my selection parameter in view A.

In all this view selection is to happen Dynamically i.e at run time.

In any of the selection the view(i.e view x)remains same.

Also is there any way by which we can enable and disable tab(that is tab 1 or tab2) based on the selection criteria of view A

Can any one guide me how it is possible. OR is there any alternate means to implement the same

Regards

Nitin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I would say the simplest way is to map pback the parameters of view A you want to share back to the component controller and then also make them available in view B.

in view B, tab1 have a ViewContainerUiElement containing view X.

Then in view B, tab2 could have 3 ViewContainerUiElement (containing view P,view Q,view R) and you can just hide the ones you don't need by binding a 3 wdvisibility context field to the visible property of the 3 ViewContainerUiElements.

Note that the method to embed the view in the ViewContainerUIElement is to open the window containing the view by double clicking on it - if you resize view B there will the 4 boxes inside - one for each ViewContainerUIElement you can then embed the other view by right clicking on them and selcting embed view.

hope this helps

rm

0 Kudos

Hi...

I just want to ask that if the number of view containers in tab 2(of view B) are 25

then will there be any performance issue. will the page upload time increase.

At a time only one container has to be enavled(visibility) rest will be hidden.

can You please guide me where I have to do the coding to get the view, based on the selection(dropdown) done in view A.

Also how the control from one view(i.e from View A) will flow to the view(view P/view Q/ view R) present in tab 2. As tab2 is present in view B so first view B has to be given the control , and in this tab 2 the views(view P/view Q/ view R) are present(i.e embeded in seperate view UI container

can u please guide me some coding part also

Regards

Nitin

Former Member
0 Kudos

Hi,

Use a ViewContainerUIElement in the tab2 of the viewB.

1. Create a ViewContainerUIElement in the RootContainer of the view of tab2.

2. Embed all the view that you want to show dynamically, inside the ViewContainerUIElement.

3. Create outbound plugs on the ViewContainerUIElement and map it with the inbound plug of respective views.

4. Map the value attribute of the DropDown context to the component controller.

5. On click of tab2 in the viewB call a action and get the DropDown value from the component controller.

6. Depending on the value selected fire the approprite outbound plug using Switch statement.

String targetView = wdContext.getComponentController.CurrentContextElement.getDropDownSelectedValue();

switch (targetView) {

case P :

wdThis.wdFirePlugToViewP();

break;

case Q :

wdThis.wdFirePlugToViewQ();

break;

case R :

wdThis.wdFirePlugToApprViewR();

break;

default :

break;

}

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Nitin,

Follow the procedure below:(Assuming that there are 3 views in a container)

1. From the view which embedds the container (say A)create outbounds to each of P,Q,R view and connect them with the respective inbounds.

2.Map the attribute that holds the value selected in the dropdown to the component controller.

3.Now based on the value selected in the dropdown you can fire a plug from the

wdDoModifyview in firstTime to enable the view.


if(firstTime){
    String attValue =wdThis.wdGet<Name of the Controller>().wdGetContext().currentContextElement().get<Name of the Attribute>();
// You can compare this values say 1 2 3 correspond to P,Q,R.
if(attValue.equals(1)){
wdThis.wdFirePlug<to the view corresponding to the value>();
}
// Repeat the same for other views.
}

Hope this helps

Regards

Amit

Former Member
0 Kudos

Hi Nitin,

This can be achived by using view container as its not possible to access any viewSets programatically.

Here is what can be done:

You can add a view container in a view which can in turn imbed views within now there can be a navigation between views within the container.This navigation can be based on what you select in the dropdown i.e. the name of the view you want to navigate in the view container which will have one default view which can in turn be the default selection of the dropdown.Fire of the plug can take place from the wdDoModify (FirstTime) this can be based on the attribute value of the component controller which will be set by DD selection(can be name of the plug or view).

This should work.

Regards

Amit

    • Reward points if found useful