Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Questions about embedding component interfaces

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

Former Member
replied

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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question