Skip to Content
0
Former Member
Nov 25, 2009 at 02:52 PM

error of removeAllChildren

14 Views

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