cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with referencing data component

bernd_speckmann
Contributor
0 Kudos

Hello,

I have got the following problem:

I have created a component like this in the wdDoInit:

IWDComponentUsage referencedComp = wdThis.wdGetDataCompInstComponentUsage();
	  referencedComp.createComponent();

...

mainL_Usage = wdThis.wdGetIMainLeftInstComponentUsage();
	  mainR_Usage = wdThis.wdGetIMainRightInstComponentUsage();

...

if (mainR_Usage.hasActiveComponent() == true) {
		  mainR_Usage.deleteComponent();
	  }
	  if (!mainR_Usage.hasActiveComponent()) {
		  mainR_Usage.createComponent("Componentname","DC");		  
		  wdThis.wdGetIMainRightInstInterface().referenceDataComp(wdThis.wdGetDataCompInstComponentUsage());		  		  
	  }

In another method I want to create another component via mainL_Usage.

But there seems to be a problem with this. I get the following error message:

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: ComponentUsage(Component:DataCompInst, createOnDemand=false, no active component): Active component must exist when getting interface controller. (Hint: Have you forgotten to create it with createComponent()? Should the lifecycle control of the component usage be "createOnDemand"?)

When I create the component in the wdDoInit additionally to the other component it works great. So the problem seems to be the creation in another method.

Anybody out there who can help me?

Thanks ahead

Accepted Solutions (0)

Answers (1)

Answers (1)

bernd_speckmann
Contributor
0 Kudos

Found the problem.