cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing an embedded component by another one

Former Member
0 Kudos

Hi!

I have created a WD component interface (let's name it INTERFACE) and I am using this in a main component (let's call it MAIN). Then I have two interface Implementations (many will follow), let's name them IMPL_1 and IMPL_2.

In the MAIN-component I have an ViewcontainerUIElement, that is connected with the Usage of the interface. When the user clicks a button, a specific implementation - e.g. IMPL_1 should be embedded there. this works by calling CREATE_COMPONENT( 'IMPL_1' ).

If the user clicks another button, another implementation of the interface should be shown there - so I remove the existing component via DELETE_COMPONENT and create the new one with CREATE_COMPONENT( 'IMPL_2' ).

That does not throw any error, but the embedded view disappears and will never come back again.

So my question is: what is the easiest way to replace an embedded component IMPL_1 with another one IMPL_2 - both implementing the same interface! This should be fairly simple, as I'm referencing just the interface in the MAIN-Component.

Any hints? I'm just finding very difficult solutions with PREPARE_DYNAMIC_NAVIGATION and so on - but I don't want to recreat all Plug-Connections again as they have been connected in the designer using the interface-definition....

Thanks in advance!

TopperDEL

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Topper,

if I remember right, you have to fire a plug in order to "activate" the embedded View. So if you already have the plugs from your embedding component to the inner one try firing this plug after creating the component.

Regards

Robert

Former Member
0 Kudos

Hi Robert,

that sounds like a solution to my problem, yes. Unfortunately I'm not at that system until thuesday. But I will try this and post back what happened.

But thanks so far for that hint! I think that'll work!

Sincerely,

TopperDEL

Former Member
0 Kudos

Hi Robert,

yes, that's the solution to my problem. I just called my init plug an the view displays as expected. Very nice.

Thank you so much!

Kind regards,

TopperDEL

Answers (0)