cancel
Showing results for 
Search instead for 
Did you mean: 

View Container UI element, calling different views

Former Member
0 Kudos

Hi,

How to trigger different views in the view containerUI element depending on the value selected from a dropdown in the main view(First view)?

I tried wit plugs , but from the main view (what ever the value I selected from the dropdown) it is always calling default view in the viewcontainer.

Can some one tell me how to acheive this?

Regards,

Ravi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Ravi,

I think you didn't embed all the views in the view container element in window.First embed all the views in view container element where the view is attached to window.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ravi,

I would suggest you to do below steps as per my understanding :

Just assume you have 4 views 1. main view and 3 views to be shown based on dropdown selection. So....

1) In the main view create 3 View container elements and embed into the same view. Let say..

window->mainview> VC1>view2

> vc2> view3

> vc3> view4

2) In the dropdown field onselect action... make Visible only one view container element at time based on selection. So that you can achieve you job..

Hope this will help you.. all the very best..

Regards,

Sreenivasa Sarma K.

Former Member
0 Kudos

Hi Ravi,

If I have not missunderstood, your requirement is like :

1 Main View - having a ViewContainer and a DropDownByKey Elements.

Lets say you have 3 other Views View1, View2 and View3 to be called.

- Define Plugs for them and create Chain in the Window of the Component.

- Also embed all the three views in the ViewContainer in the Main View over there.

- In the Submit button of the Main View, read the value of the DropDown Element.

- Based on the condition, you can fire the outbound plugs.

Thanks,

Shweta

arjun_thakur
Active Contributor
0 Kudos

Hi Ravi,

I don't think there should be any problem while using plugs. I have tried it myself and it is working.

I wrote following code in the onselect method of the drop down



   DATA key type string.
key = wdevent->get_string( 'KEY' ).

if key = '01'. " 01 is the key of the element present in the drop down list
    wd_this->fire_to1_plg(
    ).

    ELSEIF key = '02'.
        wd_this->fire_to2_plg(
        ).
ENDIF.

I hope it helps.

Regards

Arjun