cancel
Showing results for 
Search instead for 
Did you mean: 

error of removeAllChildren

Former Member
0 Kudos

Hello friends

I made a function that is called more than once here is the source:

IWDGroup groupElement = (IWDGroup) view.getElement("GroupClassi");

groupElement.removeAllChildren();

for(int i=0;i<wdContext.nodeClassi().size();i++){

wdContext.nodeClassi().moveTo(i);

IWDLinkToAction la = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, ""+i );

la.setOnAction(wdThis.wdGetMyAction());

la.setEnabled(true);

la.setText("pippo");

la.setVisible(WDVisibility.VISIBLE);

groupElement.addChild(la);

}

but it gives me this error:

com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: View: Can not add duplicate element with ID "0" of type com.sap.tc.webdynpro.clientserver.uielib.standard.impl.LinkToAction

error must be on

IWDLinkToAction la = (IWDLinkToAction) view.createElement (IWDLinkToAction.class, "" + i);

Do you have any suggestions?

Thanks

Banana

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

solved the problem .....

I did the following:

IWDLinkToAction la = (IWDLinkToAction) view.createElement(IWDLinkToAction.class, null);

Regards

Banana

Edited by: Captain Banana on Nov 25, 2009 4:13 PM

Former Member
0 Kudos

You would better have used destroyAllChildren(). removeAllChildren() does not destroy the children, they remain stored in the view and their IDs cannot be reused.

Armin