cancel
Showing results for 
Search instead for 
Did you mean: 

Questions about embedding component interfaces

Former Member
0 Kudos

Hi,

I want to embedd several views with the same interface in my window.

Only one view is visible at the same time and which view should be determined dynamically.

So I created a Component Interface with some methods in component interface controller and a Interface View Definition (named ITaskInterfaceDefinition). Every component I want to embed implements this interface.

I can embed the ITaskInterfaceDefinition in my Mainview like every other view. But now I dont know how to create an instance of the component? How to assign the component as implementing unit for the embedded ITaskInterfaceDefinition?

thx in advance

Tom

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

Hi Thomas,

Let assume you have declared ITaskInterfaceDefinition as <b>Required Controllers</b> and component which implements ITaskInterfaceDefinition has name "com.sap.sdn.Task"


IWDComponentUsage usage = wdThis.wdGetITaskInterfaceDefinitionComponentUsage(); 

if (!usage.hasActiveComponent()){ 
	try{   
		usage.createComponent("com.sap.sdn.Task");
	}catch(WDRuntimeException e){
		//handle exception
	}
}

Best regards, Maksim Rashchynski.

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you both very much! Of course points to you guys!

I think the first answer was exactly the hint I was looking for. Embed only one Interface and create the Components in my code. If I have 20 views with the same interface I can embed only one interface and use some mapping to create the components.

One additional question. In my interface view definition (in the Component Interface), which I embed as visual part of my component I defined several inbound plugs.

These inbound plugs result in window inbound plugs in the implementing component. How do I map these window plugs to my inbound plugs of the views inside my component?

luciano_leitedasilva
Contributor
0 Kudos

Hi Thomas,

In my opinion, you have to create a WD component to each View that you wish to use in the winodwmain component. Each WD component will have its view.

Following these steps bellow:

1 - In the main component, add all others components that you have created, in "add Used Component";

2 - In the Window, embed the interface view of a component instance, for all views.

3 - Create a plugin navigation between the views.

4 - In the main code, use the following code to control the instantiation and navigation:

IWDComponentUsage component =

wdThis.wdGet<<your component>>InstComponentUsage();

component.createComponent();

wdThis.wdFirePlug<<your navigation>>();

That is your requirement?

Regards,

Luciano